* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0b1530;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px clamp(16px, 6vw, 64px);
}

.auth-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-dot {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(140deg, #0ea5e9, #22d3ee);
    color: #0b1530;
    font-weight: 800;
    display: grid;
    place-items: center;
    letter-spacing: 0.04em;
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.25);
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.25);
}

.brand-name {
    font-weight: 700;
}

.link {
    color: #7dd3fc;
    text-decoration: none;
    font-weight: 500;
}

.theme-button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px;
    overflow: hidden;
}

.theme-icon {
    width: 18px;
    height: 18px;
    filter: invert(1);
    display: block;
}

.theme-icon-moon {
    display: none;
}

.lang-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    cursor: pointer;
}

.lang-button--arrow {
    position: relative;
    padding-right: 32px;
}

.lang-button--arrow::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 12px;
    height: 8px;
    transform: translateY(-50%);
    background: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2.5 6 6 10 2.5' stroke='%23cbd5e1' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center/12px 8px;
}

body.theme-light .theme-icon-sun {
    display: none;
}

body.theme-light .theme-icon-moon {
    display: inline-block;
}

body.theme-light .theme-icon {
    filter: invert(0);
}

body.theme-light .theme-button {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .lang-button {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

body.theme-light .lang-button--arrow::after {
    background: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2.5 6 6 10 2.5' stroke='%231f2937' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center/12px 8px;
}

.lang-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.lang-modal.open {
    display: flex;
}

.lang-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
}

.lang-modal__dialog {
    position: relative;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(11, 21, 48, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 20px;
    width: min(320px, 90vw);
    z-index: 1;
}

.lang-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #e2e8f0;
}

.lang-modal__close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    cursor: pointer;
}

.lang-modal__body {
    display: grid;
    gap: 10px;
}

.lang-option {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

body.theme-light .lang-modal__dialog {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

body.theme-light .lang-modal__header {
    color: #0f172a;
}

body.theme-light .lang-modal__close {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.04);
    color: #0f172a;
}

body.theme-light .lang-option {
    border-color: rgba(0, 0, 0, 0.08);
    background: #f8fafc;
    color: #0f172a;
}

.auth-main {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px 16px 48px;
}

.auth-card {
    width: min(1100px, 100%);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.auth-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.auth-card-grid--split .auth-visual {
    display: block;
}

.auth-visual {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-height: 320px;
}

.auth-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

body.theme-light {
    background: #f5f7fb;
    color: #0f172a;
}

body.theme-light .auth-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

body.theme-light .auth-header,
body.theme-light .auth-panel {
    background: transparent;
}

body.theme-light .link {
    color: #0f172a;
}

body.theme-light .auth-form input,
body.theme-light .auth-form select {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

body.theme-light .auth-form input {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.05);
}

body.theme-light .password-toggle {
    color: #1f2937;
}

body.theme-light .role-switch {
    border-color: #d5dbe5;
    background: #e9edf3;
}

body.theme-light .role-btn {
    color: #444b5b;
}

body.theme-light .role-btn.is-active {
    background: #178bff;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(23, 139, 255, 0.28);
    margin: 5px;
    border-radius: 15px;
}

body.theme-light .notice[data-tone="error"] {
    color: #b91c1c;
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.4);
}

body.theme-light .notice[data-tone="success"] {
    color: #15803d;
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.4);
}

body.theme-light .notice[data-tone="info"] {
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.4);
}

h1 {
    margin: 0 0 12px;
    font-weight: 600;
}

.subtitle {
    margin: 0 0 16px;
    color: #94a3b8;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.role-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    margin-bottom: 10px;
}

.role-btn {
    border: none;
    background: transparent;
    padding: 12px 10px;
    min-height: 46px;
    color: #d4deea;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.role-btn.is-active {
    background: #178bff;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(23, 139, 255, 0.28);
    margin: 5px;
    border-radius: 15px;
}

.role-btn:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.1);
}

.role-switch input[type="hidden"] {
    display: none;
}

.auth-form label {
    display: grid;
    gap: 6px;
    color: #cbd5e1;
    font-weight: 600;
}



.auth-form input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 16px;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.password-toggle:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
}

.password-toggle__icon {
    width: 18px;
    height: 18px;
    display: block;
}

.password-toggle__icon--hide {
    display: none;
}

.password-toggle.is-revealed .password-toggle__icon--show {
    display: none;
}

.password-toggle.is-revealed .password-toggle__icon--hide {
    display: block;
}

.auth-form input.input-error {
    border-color: rgba(248, 113, 113, 0.65);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.3);
}

.auth-form select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    appearance: none;
}

.auth-form input:focus-visible,
.auth-form select:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
}

.notice {
    display: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid transparent;
}

.notice[data-tone="error"] {
    display: block;
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fecdd3;
}

.notice[data-tone="success"] {
    display: block;
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.4);
    color: #a7f3d0;
}

.notice[data-tone="info"] {
    display: block;
    background: rgba(125, 211, 252, 0.12);
    border-color: rgba(125, 211, 252, 0.4);
    color: #e0f2fe;
}

.auth-form input:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
}

.field-error {
    color: #fecdd3;
    font-size: 13px;
    line-height: 1.4;
}

body.theme-light .auth-form input.input-error {
    border-color: rgba(248, 113, 113, 0.7);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.28);
}

body.theme-light .field-error {
    color: #b91c1c;
}

.actions {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.actions button {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: #178bff;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: none;
    font-size: 16px;
}

.auth-switch-text {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 400;
}

.auth-switch-muted {
    color: #8a94a8;
}

.auth-switch-link {
    color: #178bff;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch-link:hover {
    text-decoration: underline;
}

.auth-agree {
    display: flex !important;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.3;
}

.auth-agree input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #178bff;
    cursor: pointer;
}

.auth-agree span {
    line-height: 1.4;
    display: inline-block;
}

body.theme-light .auth-agree {
    color: #4b5563;
}

.auth-forgot {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

.auth-forgot-link {
    font-size: 14px;
    color: #178bff;
    text-decoration: none;
    font-weight: 500;
}

.auth-forgot-link:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .auth-card-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 20px;
    }

    .auth-card-grid--split .auth-visual {
        display: none;
    }
}

@media (max-width: 520px) {
    .auth-card {
        width: 100%;
        padding: 20px;
    }

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

    .auth-visual,
    .auth-card-grid--split .auth-visual {
        display: none;
    }

    .auth-fields {
        margin-top: 0;
    }
}
