:root {
    --ink: #ffffff;
    --muted: #c8d4e6;
    --line: #405a7b;
    --surface: #202b49;
    --brand: #3f5878;
    --brand-strong: #496789;
    --success: #2f7d50;
    --page: #071226;
}

body {
    min-height: 100vh;
    background: var(--page);
    color: var(--ink);
    font-family: system-ui, -apple-system, Arial, sans-serif;
}

.app-shell {
    min-height: 100vh;
}

.login-view[hidden],
.signature-view[hidden],
.config-warning[hidden] {
    display: none !important;
}

.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.login-panel {
    width: min(568px, 100%);
    padding: 36px 24px;
    border: 1px solid rgba(64, 90, 123, 0.28);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.login-logo {
    display: block;
    max-width: 190px;
    max-height: 74px;
    margin: 0 auto 28px;
    filter: invert(0) brightness(100);
}

.login-copy {
    max-width: 430px;
    margin: 0 auto 28px;
    color: #fff;
    font-size: 16px;
    line-height: 1.45;
}

.config-warning {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #ebc46a;
    border-radius: 6px;
    background: #fff8e5;
    color: #6e4e00;
    font-size: 13px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 0 18px;
    font-weight: 700;
}

.primary-button {
    width: min(360px, 100%);
    background: var(--brand-strong);
    color: #fff;
}

.primary-button:hover {
    background: #557497;
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.secondary-button {
    background: #b3261e;
    border-color: #b3261e;
    color: #fff;
}

.secondary-button:hover {
    background: #8f1f19;
    border-color: #8f1f19;
}

.signature-view {
    min-height: 100vh;
    background: #202b49;
    color: #182033;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
    background: #202b49;
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand img {
    width: 108px;
    max-height: 38px;
    object-fit: contain;
    filter: invert(0) brightness(100);
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    color: #fff;
    font-size: 16px;
}

.brand span {
    color: #c8d4e6;
    font-size: 12px;
    word-break: break-word;
}

.signature-panel {
    width: min(760px, calc(100% - 32px));
    margin: 42px auto;
    padding: 28px;
    border: 1px solid #d9dee8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 35px rgba(24, 32, 51, 0.08);
}

.signature-panel #fieldset1 {
    margin-top: 0;
    border: 0;
    padding: 0;
}

.signature-panel .spacer {
    display: block;
    margin-bottom: 8px;
    color: var(--brand);
    font-size: 20px;
    font-weight: 700;
}

.form-instructions {
    display: block;
    margin-bottom: 14px;
    color: #40506a;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
}

.qlform_signature form {
    width: min(535px, 100%);
}

.qlform_signature dd input {
    width: 100%;
    min-height: 38px;
}

.qlform_signature dd.jform_tel {
    width: 100%;
    margin-left: 0;
    display: block;
}

.assinatura_nav .submit,
.assinatura_nav .copyImg {
    float: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    width: auto;
    height: 24px;
    min-height: 24px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    line-height: 24px;
    color: #fff;
    font-weight: 600;
    gap: 6px;
}

.assinatura_nav .submit {
    background: var(--brand-strong);
}

.assinatura_nav .submit:hover {
    background: #557497;
}

.assinatura_nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: min(535px, 100%);
    min-height: 40px;
    margin: 18px auto 0;
    padding: 8px 0;
}

#assinatura_container {
    display: block;
    position: relative;
    width: min(535px, 100%);
    margin: 0 auto;
    padding-top: 0;
}

#assinatura_download {
    position: absolute;
    right: 8px;
    top: 8px;
}

.assinatura_nav .copyImg {
    border: 1px solid transparent;
    background: var(--success);
    color: #fff;
}

.assinatura_nav .copyImg[hidden] {
    display: none;
}

.assinatura_spassu:empty {
    display: none;
}

@media (max-width: 640px) {
    .topbar {
        align-items: flex-start;
        padding: 16px;
    }

    .brand {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .signature-panel {
        margin: 20px auto;
        padding: 18px;
    }

    .assinatura_spassu {
        overflow-x: auto;
        padding: 18px;
    }
}
