/* Unified public auth shell for admin, developer and agent entrances. */
:root {
    --auth-primary: #2c9678;
    --auth-primary-dark: #1e7d5c;
    --auth-primary-soft: rgba(44, 150, 120, 0.1);
    --auth-bg: #f5f7f6;
    --auth-panel: #ffffff;
    --auth-text: #1f2933;
    --auth-muted: #6b7280;
    --auth-border: #e5ebe8;
    --auth-shadow: 0 18px 45px rgba(31, 41, 51, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    min-height: 100vh;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(44, 150, 120, 0.08), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #ffffff 0%, var(--auth-bg) 100%);
}

#LAY-user-login.auth-page {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    background:
        linear-gradient(135deg, rgba(44, 150, 120, 0.08), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #ffffff 0%, var(--auth-bg) 100%);
}

#LAY-user-login.auth-page::before {
    content: none;
    display: none;
}

.auth-back {
    position: fixed;
    top: 22px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-muted);
    font-size: 14px;
    text-decoration: none;
    z-index: 20;
}

.auth-back:hover,
.auth-back:focus {
    color: var(--auth-primary);
    text-decoration: none;
}

.auth-shell {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1fr);
    gap: 24px;
    align-items: stretch;
}

.auth-brand,
.auth-card {
    background: var(--auth-panel);
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    box-shadow: var(--auth-shadow);
}

.auth-brand {
    padding: 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--auth-primary), var(--auth-primary-dark));
}

.auth-logo-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}

.auth-logo-row img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(44, 150, 120, 0.18);
}

.auth-kicker {
    display: block;
    color: var(--auth-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 4px;
}

.auth-site {
    margin: 0;
    color: var(--auth-text);
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
}

.auth-brand-title {
    margin: 0 0 14px;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-brand-copy {
    margin: 0;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.8;
}

.auth-feature-list {
    display: grid;
    gap: 12px;
    margin-top: 34px;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #374151;
    font-size: 14px;
}

.auth-feature i {
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 7px;
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
    flex: 0 0 28px;
}

.auth-contact {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-border);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-contact img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

.auth-card {
    padding: 34px;
}

.auth-card-header {
    margin-bottom: 24px;
}

.auth-card-header h2 {
    margin: 0 0 8px;
    color: var(--auth-text);
    font-size: 24px;
    line-height: 1.35;
    font-weight: 700;
}

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

.auth-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--auth-primary);
    font-size: 13px;
    font-weight: 700;
}

.auth-form .layui-form-item {
    margin-bottom: 16px;
}

.auth-field {
    position: relative;
}

.auth-field .layui-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa5b1;
    font-size: 18px;
    pointer-events: none;
}

.auth-field .layui-input {
    height: 46px;
    padding-left: 44px;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    color: var(--auth-text);
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field .layui-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(44, 150, 120, 0.1);
}

.auth-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 10px;
}

.auth-code-image {
    width: 100%;
    height: 46px;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    background: #fff;
}

.auth-secondary-btn {
    width: 100%;
    height: 46px;
    padding: 0 10px;
    border: 1px solid rgba(44, 150, 120, 0.28);
    border-radius: 6px;
    background: #fff;
    color: var(--auth-primary);
    font-weight: 600;
}

.auth-secondary-btn:hover,
.auth-secondary-btn:focus {
    border-color: var(--auth-primary);
    color: var(--auth-primary-dark);
    background: rgba(44, 150, 120, 0.06);
}

.auth-submit {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(44, 150, 120, 0.22);
}

.auth-submit:hover,
.auth-submit:focus {
    color: #fff;
    background: linear-gradient(135deg, #278b70, #196f51);
}

.auth-options,
.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-options {
    margin: 4px 0 18px;
    color: var(--auth-muted);
    font-size: 14px;
}

.auth-actions {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-border);
    flex-wrap: wrap;
}

.auth-note {
    width: 100%;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.6;
}

.auth-link {
    color: var(--auth-muted);
    font-size: 14px;
    text-decoration: none;
}

.auth-link:hover,
.auth-link:focus {
    color: var(--auth-primary);
    text-decoration: none;
}

.auth-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
    text-decoration: none;
}

.auth-social:hover {
    color: var(--auth-primary-dark);
    text-decoration: none;
}

#captcha {
    width: 100%;
    min-height: 48px;
    margin: 0 0 16px !important;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-muted);
    overflow: hidden;
}

#captcha_text {
    color: var(--auth-muted);
    font-size: 14px;
}

.loading {
    display: inline-flex;
    gap: 4px;
}

.loading-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--auth-primary);
    animation: authDot 1.2s infinite ease-in-out both;
}

.loading-dot:nth-child(1) { animation-delay: -0.3s; }
.loading-dot:nth-child(2) { animation-delay: -0.2s; }
.loading-dot:nth-child(3) { animation-delay: -0.1s; }

@keyframes authDot {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.45; }
    40% { transform: scale(1); opacity: 1; }
}

.auth-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 18px;
    text-align: center;
    color: #8a949e;
    font-size: 13px;
}

.auth-footer a {
    color: inherit;
}

.layui-layer-btn a {
    background: var(--auth-primary) !important;
    border-color: var(--auth-primary) !important;
}

@media (max-width: 920px) {
    .auth-page {
        padding: 68px 18px 48px;
        align-items: flex-start;
    }

    #LAY-user-login.auth-page {
        align-items: flex-start;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 26px;
    }

    .auth-brand-title {
        font-size: 24px;
    }

    .auth-card {
        padding: 26px;
    }

    .auth-footer {
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 520px) {
    .auth-back {
        top: 16px;
        left: 16px;
    }

    .auth-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .auth-brand {
        display: none;
    }

    .auth-card {
        padding: 22px;
    }

    .auth-code-row {
        grid-template-columns: 1fr;
    }

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