/* Auth Pages Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0D0B14;
    color: #fff;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.5;
    margin: 0;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: auto;
}

.auth-card {
    background: rgba(19, 17, 28, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 32px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    display: inline-block;
    margin-bottom: 20px;
    transition: transform 0.3s;
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-logo img {
    width: 64px;
    height: 64px;
    border-radius: 0;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4));
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #F87171;
}

.alert-error::before {
    content: '⚠';
}

.alert-success {
    background: rgba(6, 214, 160, 0.15);
    border: 1px solid rgba(6, 214, 160, 0.3);
    color: #34D399;
}

.alert-success::before {
    content: '✓';
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    padding-left: 2px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon>svg {
    position: absolute;
    left: 14px;
    color: rgba(139, 92, 246, 0.6);
    pointer-events: none;
    transition: color 0.2s;
    width: 18px;
    height: 18px;
    z-index: 1;
}

.input-with-icon:focus-within>svg {
    color: #8B5CF6;
}

.input-with-icon input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.input-with-icon input:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.06);
}

.input-with-icon input:focus {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.input-with-icon input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* Phone input - show numeric keyboard on mobile */
input[type="tel"] {
    font-variant-numeric: tabular-nums;
}

.toggle-password {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 8px;
    display: flex;
    border-radius: 8px;
    transition: all 0.2s;
}

.toggle-password:hover,
.toggle-password.active {
    color: #8B5CF6;
    background: rgba(139, 92, 246, 0.15);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.input-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    padding-left: 2px;
}

/* Checkbox */
.checkbox-group {
    margin-top: 2px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    transition: color 0.2s;
    padding: 4px 0;
}

.checkbox-label:hover {
    color: rgba(255, 255, 255, 0.9);
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-top: 1px;
}

.checkbox-label:hover .checkmark {
    border-color: rgba(139, 92, 246, 0.6);
}

.checkbox-label input:checked+.checkmark {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    border-color: #8B5CF6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.checkbox-label input:checked+.checkmark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    margin-bottom: 3px;
}

.checkbox-label a {
    color: #A78BFA;
    text-decoration: none;
    transition: color 0.2s;
}

.checkbox-label a:hover {
    color: #C4B5FD;
    text-decoration: underline;
}

.checkbox-label strong {
    color: #fff;
}

/* Submit Button */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 24px;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-submit:hover::before {
    opacity: 1;
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-submit svg {
    transition: transform 0.2s;
    width: 18px;
    height: 18px;
}

.btn-submit:hover svg {
    transform: translateX(3px);
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-footer p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.auth-footer a {
    color: #A78BFA;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #C4B5FD;
    text-decoration: underline;
}

/* Back Home Link */
.back-home {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    padding: 12px;
    border-radius: 10px;
}

.back-home:hover {
    color: #A78BFA;
    background: rgba(139, 92, 246, 0.1);
}

.back-home svg {
    transition: transform 0.2s;
    width: 18px;
    height: 18px;
}

.back-home:hover svg {
    transform: translateX(-4px);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
        align-items: center;
        justify-content: center;
    }

    .auth-container {
        justify-content: center;
    }

    .auth-card {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .auth-logo img {
        width: 56px;
        height: 56px;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .auth-header h1 {
        font-size: 22px;
    }

    .auth-header p {
        font-size: 13px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .auth-form {
        gap: 14px;
    }

    .form-group label {
        font-size: 12px;
    }

    .input-with-icon input {
        height: 46px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
        padding-left: 42px;
        border-radius: 10px;
    }

    .input-with-icon>svg {
        left: 12px;
        width: 17px;
        height: 17px;
    }

    .toggle-password {
        right: 6px;
        padding: 6px;
    }

    .btn-submit {
        height: 50px;
        font-size: 14px;
        border-radius: 10px;
        margin-top: 6px;
    }

    .checkbox-label {
        font-size: 12px;
        gap: 10px;
    }

    .checkmark {
        width: 20px;
        height: 20px;
        min-width: 20px;
        border-radius: 5px;
    }

    .auth-footer {
        margin-top: 20px;
        padding-top: 16px;
    }

    .auth-footer p,
    .auth-footer a {
        font-size: 13px;
    }

    .back-home {
        font-size: 13px;
        padding: 10px;
    }
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 480px) {

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Focus visible for accessibility */
.btn-submit:focus-visible,
.toggle-password:focus-visible,
.back-home:focus-visible,
.auth-logo:focus-visible,
.checkbox-label:focus-visible .checkmark {
    outline: 2px solid #8B5CF6;
    outline-offset: 2px;
}

/* Loading state */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-submit.loading span {
    opacity: 0;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}