* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111827;
    height: 100vh;
    overflow: hidden;
    background-color: #0f172a; 
}

/* Crypto Static Background */
.bg-crypto {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    /* Static crypto related image from unsplash */
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.8)), url('https://images.unsplash.com/photo-1621416894569-0f39ed31d247?q=80&w=2000&auto=format&fit=crop') center/cover no-repeat;
}

/* Layout */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

/* Glassmorphism Auth Card */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
}

.auth-card::-webkit-scrollbar {
    width: 6px;
}
.auth-card::-webkit-scrollbar-track {
    background: transparent;
}
.auth-card::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 30px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    position: relative;
    background-color: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 30px;
    width: 100%;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.toggle-container.hidden {
    opacity: 0;
    height: 0;
    margin-bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.toggle-switch {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-in-out;
}

.toggle-btn {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    border-radius: 8px;
    transition: color 0.3s ease;
}

.toggle-btn.active {
    color: #111827;
}

/* Form Content Wrapper (For JS animated height) */
.form-content-wrapper {
    position: relative;
    width: 100%;
    transition: height 0.4s ease-in-out;
    overflow: hidden;
}

.form-section {
    width: 100%;
    position: absolute; /* Stack them for crossfading */
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.form-section.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transition-delay: 0.1s; /* wait for out-animation slightly */
}

/* Typography */
.welcome-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-align: center;
}

.welcome-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.5;
    text-align: center;
}

.demo-note {
    font-size: 13px;
    color: #059669;
    text-align: center;
    margin-bottom: 20px;
    background: #ecfdf5;
    padding: 8px;
    border-radius: 8px;
}

/* Form Groups */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.input-group input {
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    background: #f9fafb;
}

.input-group input:focus {
    border-color: #059669;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    background: #ffffff;
}

.input-group input::placeholder {
    color: #9ca3af;
}

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

.password-wrapper input {
    width: 100%;
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.toggle-password:hover {
    background-color: #e5e7eb;
}

.toggle-password svg.hidden {
    display: none;
}

/* OTP Inputs */
.otp-inputs {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.otp-digit {
    width: 100%;
    aspect-ratio: 1;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    outline: none;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.otp-digit:focus {
    border-color: #059669;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    background: #ffffff;
    transform: translateY(-2px);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #059669;
    border-color: #059669;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.forgot-password {
    font-size: 14px;
    color: #059669;
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    background-color: #059669;
    color: #ffffff;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #047857;
}

.submit-btn:active {
    transform: scale(0.97); 
}

/* Animations container */
.success-animation, .failure-animation {
    display: none;
    align-items: center;
    justify-content: center;
}

/* Button States */
.submit-btn.success {
    background-color: #10b981;
    pointer-events: none;
}
.submit-btn.success .btn-text, .submit-btn.failure .btn-text {
    display: none;
}
.submit-btn.success .success-animation {
    display: flex;
}

.submit-btn.failure {
    background-color: #ef4444; 
    pointer-events: none;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
.submit-btn.failure .failure-animation {
    display: flex;
}

/* SVGs */
.checkmark-svg, .cross-svg {
    width: 28px;
    height: 28px;
    display: block;
}

.checkmark-circle, .cross-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #fff;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    stroke: #fff;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

.cross-path {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    stroke-width: 3;
    stroke: #fff;
    stroke-linecap: round;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Back Button */
.back-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    position: absolute;
    top: 0px;
    left: 0px;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.back-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

#otpSection, #forgotPasswordSection {
    padding-top: 10px;
}
