/* User Authentication & Enrollment CSS */
/* Enhanced with Interactive Animations */

/* CRITICAL: Box-sizing fix for responsive layout */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    overflow-x: hidden;
    width: 100%;
}

/* ==================== */
/* ANIMATION KEYFRAMES  */
/* ==================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(-45deg);
    }

    100% {
        transform: scale(1) rotate(-45deg);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.15);
    }
}

/* ==================== */
/* TWO COLUMN LAYOUT    */
/* ==================== */

.login-page-container {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    max-width: 1100px;
    width: 100%;
    align-items: start;
    z-index: 10;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

/* ==================== */
/* AUTH CONTAINER       */
/* ==================== */

.auth-container {
    background: var(--card-bg);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    text-align: center;
    position: relative;
    z-index: 10;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease;
}

/* Glassmorphism Effect */
.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* ==================== */
/* FORM ELEMENTS        */
/* ==================== */

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

/* Floating Label Style */
.form-group.floating {
    margin-top: 0.5rem;
}

.form-group.floating .form-label {
    position: absolute;
    left: 2.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    padding: 0;
    margin: 0;
    color: #94a3b8;
}

.form-group.floating .form-input:focus~.form-label,
.form-group.floating .form-input:not(:placeholder-shown)~.form-label {
    top: -0.625rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: var(--primary-color);
    background: white;
    padding: 0 0.375rem;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    background: white;
}

.form-input::placeholder {
    color: transparent;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-input:focus::placeholder {
    color: #cbd5e1;
}

/* Input States */
.form-input.error {
    border-color: var(--error-color);
    animation: shake 0.4s ease;
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: var(--success-color);
}

.form-input.success:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* Input Icon Animation */
.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: all 0.25s ease;
    pointer-events: none;
}

.form-input:focus~.input-icon,
.form-group:focus-within .input-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

/* ==================== */
/* BUTTONS              */
/* ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    width: 100%;
    padding: 0.975rem;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    font-size: 1rem;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.35);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.35);
}

/* Button Loading State */
.btn .spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

/* ==================== */
/* DIVIDER              */
/* ==================== */

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider::before {
    margin-right: .5em;
}

.divider::after {
    margin-left: .5em;
}

/* ==================== */
/* LINKS                */
/* ==================== */

.footer-link {
    display: block;
    margin-top: 1.5rem;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ==================== */
/* ONBOARDING CARD      */
/* ==================== */

.onboarding-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 520px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 2rem;
}

.onboarding-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease infinite;
}

.onboarding-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.onboarding-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ==================== */
/* STEP ITEMS           */
/* ==================== */

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInRight 0.4s ease both;
}

.step-item:nth-child(1) {
    animation-delay: 0.1s;
}

.step-item:nth-child(2) {
    animation-delay: 0.2s;
}

.step-item:nth-child(3) {
    animation-delay: 0.3s;
}

.step-item:nth-child(4) {
    animation-delay: 0.4s;
}

.step-item:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.step-item:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.step-item.completed .step-number {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.step-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.step-item:hover .step-icon {
    transform: scale(1.05) rotate(3deg);
}

.step-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.step-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ==================== */
/* PASSWORD STRENGTH    */
/* ==================== */

.password-strength {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.strength-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    display: flex;
    justify-content: space-between;
}

.strength-bar-container {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    border-radius: 3px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}

.strength-bar.weak {
    width: 33%;
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.strength-bar.medium {
    width: 66%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.strength-bar.strong {
    width: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

/* ==================== */
/* PAYMENT PAGE         */
/* ==================== */

.payment-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 1rem 0;
}

.payment-features {
    text-align: left;
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-icon {
    color: var(--success-color);
    margin-right: 0.75rem;
}

/* ==================== */
/* ONBOARDING FOOTER    */
/* ==================== */

.onboarding-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.onboarding-footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.onboarding-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.onboarding-footer a:hover {
    text-decoration: underline;
}

/* ==================== */
/* RESPONSIVE DESIGN    */
/* ==================== */

@media (max-width: 968px) {
    .login-page-container {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .onboarding-card {
        order: 2;
        margin-top: 1.5rem;
    }

    .auth-container {
        order: 1;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    .onboarding-card,
    .auth-container {
        padding: 1.5rem;
    }

    .step-item {
        padding: 1rem;
    }

    .step-icon,
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .form-input {
        font-size: 16px;
        min-height: 48px;
    }

    .btn-primary {
        min-height: 52px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.75rem;
    }

    .auth-container,
    .onboarding-card {
        padding: 1.25rem;
        border-radius: 14px;
    }

    .auth-logo {
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }

    .auth-title {
        font-size: 1.375rem;
    }

    .auth-subtitle {
        font-size: 0.875rem;
    }

    .step-item {
        padding: 0.875rem;
        gap: 0.75rem;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .onboarding-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 375px) {
    body {
        padding: 0.5rem;
    }

    .auth-container,
    .onboarding-card {
        padding: 1rem;
    }

    .auth-logo {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }

    .auth-title {
        font-size: 1.25rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }
}