:root {
    --auth-orange: #f08a00;
    --auth-orange-dark: #d27200;
    --auth-lime: #9fc31f;
    --auth-text: #2b2b2b;
    --auth-muted: #6f6a64;
    --auth-border: #e3ddd4;
    --auth-surface: #ffffff;
    --auth-bg-1: #fff8ef;
    --auth-bg-2: #f3f6ea;
    --auth-danger: #c0392b;
    --auth-danger-bg: #fdecea;
    --auth-info-bg: #fff4e3;
    --auth-success: #4f7a12;
    --auth-success-bg: #f1f7e3;
    --auth-focus: rgba(240, 138, 0, 0.22);
}

body {
    background: radial-gradient(circle at 15% 10%, var(--auth-bg-1) 0, transparent 55%),
                radial-gradient(circle at 85% 90%, var(--auth-bg-2) 0, transparent 55%),
                #faf8f5;
    background-attachment: fixed;
}

body .logo {
    max-width: 100%;
    background-size: contain;
    background-position: center;
    margin-top: 12px;
    background-image: url(images/solare-transparent.png);
}

body .content .cph {
    padding: 4px 16px 24px;
}

.auth-shell {
    display: flex;
    justify-content: center;
    padding: 8px 0 32px;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(60, 40, 10, 0.06),
                0 8px 24px rgba(60, 40, 10, 0.08),
                0 24px 48px -12px rgba(60, 40, 10, 0.14);
    overflow: hidden;
    font-size: 14px;
    color: var(--auth-text);
    animation: auth-rise 0.35s ease-out;
}

.auth-card::before {
    content: "";
    display: block;
    height: 5px;
    background: linear-gradient(90deg, var(--auth-orange) 0%, #f7b733 50%, var(--auth-lime) 100%);
}

.auth-card-wide {
    max-width: 480px;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    padding: 24px 28px 4px;
}

.auth-header h1 {
    margin: 0 0 6px;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--auth-text);
}

.auth-header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.5;
}

.auth-body {
    padding: 18px 28px 26px;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label,
.auth-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .auth-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a59c90;
    pointer-events: none;
    font-size: 14px;
}

input.auth-input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 12px 0 36px;
    font-size: 15px;
    color: var(--auth-text);
    background: #fdfcfa;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

input.auth-input.auth-input-plain {
    padding-left: 12px;
}

input.auth-input:hover {
    border-color: #cfc6b8;
}

input.auth-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--auth-orange);
    box-shadow: 0 0 0 4px var(--auth-focus);
}

input.auth-input.input-validation-error {
    border-color: var(--auth-danger);
    background: #fffafa;
}

.auth-input-wrap.has-toggle input.auth-input {
    padding-right: 44px;
}

.auth-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #8c8378;
    border-radius: 6px;
    cursor: pointer;
}

.auth-toggle:hover,
.auth-toggle:focus {
    color: var(--auth-orange-dark);
    background: #fbf3e8;
    outline: none;
}

input.auth-code {
    height: 54px;
    padding: 0 12px;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 10px;
    font-family: Consolas, "Courier New", monospace;
}

.auth-field .field-validation-error {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--auth-danger);
}

.auth-hint {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    color: #9a5b00;
}

.auth-hint.is-visible {
    display: block;
}

.auth-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 4px 0 20px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text);
    cursor: pointer;
    user-select: none;
}

.auth-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--auth-orange);
    cursor: pointer;
}

.auth-check label {
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #fff !important;
    background: linear-gradient(180deg, #f59a1c 0%, var(--auth-orange) 100%);
    border: 1px solid var(--auth-orange-dark);
    border-radius: 8px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 14px -4px rgba(240, 138, 0, 0.55);
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
    text-decoration: none !important;
}

.auth-btn:hover {
    filter: brightness(1.04);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 20px -6px rgba(240, 138, 0, 0.6);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--auth-focus), 0 6px 14px -4px rgba(240, 138, 0, 0.55);
}

.auth-btn[disabled] {
    opacity: 0.75;
    cursor: wait;
}

.auth-btn-secondary {
    color: var(--auth-orange-dark) !important;
    background: #fff;
    border: 1px solid var(--auth-border);
    box-shadow: none;
}

.auth-btn-secondary:hover {
    background: #fdf6ec;
    box-shadow: none;
}

.auth-link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--auth-orange-dark);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.auth-link-btn:hover,
.auth-link-btn:focus {
    text-decoration: underline;
    outline: none;
}

.auth-card a {
    color: var(--auth-orange-dark);
    font-weight: 700;
}

.auth-card a:hover,
.auth-card a:focus {
    color: #a95b00;
    text-decoration: underline;
}

.auth-footer {
    padding: 14px 28px;
    border-top: 1px solid #f0ebe3;
    background: #fcfaf7;
    font-size: 13px;
    text-align: center;
    color: var(--auth-muted);
}

.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 11px 13px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid transparent;
}

.auth-alert .fa {
    margin-top: 2px;
}

.auth-alert-info {
    background: var(--auth-info-bg);
    border-color: #f6dcb4;
    color: #7a4a00;
}

.auth-alert-success {
    background: var(--auth-success-bg);
    border-color: #d6e8b4;
    color: var(--auth-success);
}

.auth-card .validation-summary-errors {
    margin-bottom: 16px;
    padding: 11px 13px 11px 36px;
    position: relative;
    border-radius: 8px;
    background: var(--auth-danger-bg);
    border: 1px solid #f5c6c1;
    color: var(--auth-danger);
    font-size: 13px;
    line-height: 1.45;
}

.auth-card .validation-summary-errors::before {
    content: "\f071";
    font-family: FontAwesome;
    position: absolute;
    left: 13px;
    top: 11px;
}

.auth-card .validation-summary-errors ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-card .validation-summary-valid {
    display: none;
}

.auth-setup {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px dashed #e6cfa9;
    border-radius: 10px;
    background: #fffaf2;
}

.auth-setup img {
    flex: 0 0 auto;
    width: 132px;
    height: 132px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
}

.auth-setup ol {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--auth-muted);
}

.auth-setup code {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    font-size: 11.5px;
    word-break: break-all;
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 4px;
}

.auth-resend {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.auth-strength span {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #ece6dc;
    transition: background-color 0.2s ease;
}

.auth-strength-label {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--auth-muted);
    min-height: 15px;
}

.auth-strength[data-score="1"] span:nth-child(-n+1) { background: #d9534f; }
.auth-strength[data-score="2"] span:nth-child(-n+2) { background: #f0ad4e; }
.auth-strength[data-score="3"] span:nth-child(-n+3) { background: #c2c62b; }
.auth-strength[data-score="4"] span:nth-child(-n+4) { background: var(--auth-lime); }

.auth-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 4px auto 14px;
    border-radius: 50%;
    background: var(--auth-success-bg);
    color: var(--auth-success);
    font-size: 26px;
    box-shadow: 0 0 0 6px #f8fbf1;
}

.auth-center {
    text-align: center;
}

@media (max-width: 767px) {
    body .logo {
        width: 240px;
        height: 113px;
        margin-top: 8px;
    }

    .auth-shell {
        padding-top: 4px;
    }

    .auth-header {
        padding: 20px 20px 2px;
    }

    .auth-header h1 {
        font-size: 19px;
    }

    .auth-body {
        padding: 16px 20px 22px;
    }

    .auth-footer {
        padding: 12px 20px;
    }

    input.auth-input {
        font-size: 16px;
    }
}

@media (max-width: 420px) {
    body .content .cph {
        padding-left: 12px;
        padding-right: 12px;
    }

    body .logo {
        width: 200px;
        height: 94px;
    }

    .auth-card {
        border-radius: 12px;
    }

    .auth-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-setup {
        flex-direction: column;
        text-align: left;
    }

    .auth-setup img {
        width: 160px;
        height: 160px;
    }

    input.auth-code {
        letter-spacing: 6px;
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
    }

    .auth-btn,
    input.auth-input {
        transition: none;
    }
}
