* {
    box-sizing: border-box;
}

:root {
    --bg: #060e0c;
    --bg-card: rgba(10, 23, 20, 0.92);
    --border: rgba(74, 222, 128, 0.15);
    --border-strong: rgba(74, 222, 128, 0.3);
    --text: #e6f6ef;
    --muted: #8aa79a;
    --brand: #4ade80;
    --brand-hover: #22c55e;
    --danger: #fb7185;
    --input-bg: rgba(0, 0, 0, 0.35);
    --input-focus: rgba(74, 222, 128, 0.1);
    --glow: 0 0 30px rgba(74, 222, 128, 0.08);
}

html, body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.06);
    filter: blur(100px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.auth-card {
    width: min(430px, 100%);
    padding: 36px 32px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--glow), 0 24px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.auth-card h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
}

.auth-subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.field-group {
    margin-bottom: 18px;
}

.field-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.field-label {
    font-size: 12px;
    color: #d4ece2;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.field-error {
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
    display: none;
}

.field-error.visible {
    display: block;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.input-field {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 46px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.input-field:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px var(--input-focus);
}

.input-field.error {
    border-color: rgba(251, 113, 133, 0.5);
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.1);
}

.input-field.valid {
    border-color: rgba(74, 222, 128, 0.4);
}

.input-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-toggle:hover {
    color: var(--text);
}

.btn-submit {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #86efac, #4ade80);
    color: #05230f;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    margin-top: 6px;
    font-family: inherit;
}

.btn-submit:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(74, 222, 128, 0.3);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-code-row {
    display: flex;
    gap: 10px;
}

.btn-code-row .input-wrapper {
    flex: 1;
}

.btn-code {
    height: 50px;
    padding: 0 18px;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    font-family: inherit;
    flex-shrink: 0;
}

.btn-code:hover:not(:disabled) {
    background: rgba(74, 222, 128, 0.15);
    border-color: var(--border-strong);
}

.btn-code:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-code.sent {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
}

.footer-link-section {
    text-align: center;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer-link-section a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.footer-link-section a:hover {
    color: var(--brand-hover);
}

.footer-link-section p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    padding: 14px 28px;
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    z-index: 100;
    opacity: 0;
    transition: all 0.35s ease;
    pointer-events: none;
    font-family: inherit;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: rgba(74, 222, 128, 0.3);
}

.toast.error {
    border-color: rgba(251, 113, 133, 0.3);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-logo img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.auth-logo span {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.auth-logo .logo-accent {
    background: linear-gradient(135deg, #6ee7b7 0%, #10b981 40%, #0891b2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    background: transparent;
}

.step-circle.active {
    border-color: var(--brand);
    background: rgba(74, 222, 128, 0.15);
    color: var(--brand);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.25);
}

.step-circle.done {
    border-color: var(--brand);
    background: var(--brand);
    color: #05230f;
}

.step-connector {
    width: 36px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 6px;
    position: relative;
    overflow: hidden;
}

.step-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--brand);
    transition: width 0.3s ease;
}

.step-connector.done::after {
    width: 100%;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeStep 0.3s ease-out;
}

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

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 10px;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: rgba(74, 222, 128, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1px;
}

.checkbox-custom.checked {
    background: var(--brand);
    border-color: var(--brand);
}

.checkbox-custom svg {
    opacity: 0;
    transition: opacity 0.2s;
}

.checkbox-custom.checked svg {
    opacity: 1;
}

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

.checkbox-row a {
    color: var(--brand);
    text-decoration: none;
}

.forgot-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--brand);
}

.security-bar {
    text-align: center;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.security-text {
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
    }
    .btn-code-row {
        flex-direction: column;
    }
    .btn-code {
        width: 100%;
    }
}
