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

html {
    -webkit-text-size-adjust: 100%;
}

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

/* Crypto Static Background */
.bg-crypto {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    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;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
}

/* Glassmorphism Auth Card */
.auth-card {
    margin: auto;
    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: none;
    overflow: visible;
    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 {
    position: relative;
    display: flex;
    background: #f1f5f9;
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 28px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.07);
}

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

.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;
    transition: color 0.3s ease;
}

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

/* Form Content Wrapper */
.form-content-wrapper {
    position: relative;
    width: 100%;
    transition: height 0.3s ease-in-out;
    overflow: visible;
}

.form-section {
    width: 100%;
    position: absolute;
    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;
}

/* 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;
}

/* Input Groups */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    background: #f8fafc;
    color: #0F172A;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

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

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: #9ca3af;
}

.hidden {
    display: none !important;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #059669;
}

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

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

/* Submit Button */
.submit-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 14px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 4px 14px rgba(5,150,105,0.30) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    border: none !important;
    color: #FFFFFF !important;
    width: 100% !important;
    margin-top: 8px !important;
    transition: transform 0.15s, box-shadow 0.15s !important;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(5,150,105,0.38) !important;
}

.submit-btn:active {
    transform: translateY(0) !important;
}

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

.submit-btn.success .success-animation {
    display: flex;
}
.submit-btn.success .btn-text {
    display: none;
}
.submit-btn.failure .failure-animation {
    display: flex;
}

.checkmark-svg {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #059669;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #059669;
    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;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

.cross-svg {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
    stroke: #fff;
    stroke-width: 2;
    stroke-miterlimit: 10;
}

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

.cross-path {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #EF4444;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

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

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 30px rgba(5,150,105,0); }
}

/* Inline Error */
.inline-error {
    display: none;
    align-items: center;
    gap: 8px;
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: .65rem .9rem;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 500;
    animation: errIn .25s ease;
    margin-top: 4px;
}

.inline-error.visible {
    display: flex;
}

@keyframes errIn {
    from { opacity:0; transform:translateY(-4px); }
    to { opacity:1; transform:translateY(0); }
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

/* OTP Input */
.otp-input {
    text-align: center;
    font-size: 56px;
    letter-spacing: 24px;
    border-radius: 16px;
    border: 2px solid #16a34a;
    background: #f8fafc;
    font-weight: 900;
    padding: 20px 12px;
    transition: all 0.2s;
    width: 100%;
    color: #0f172a;
    cursor: text;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
    font-family: inherit;
}

.otp-input:focus {
    border-color: #059669;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(5,150,105,0.12);
    outline: none;
}

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

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

/* Mobile */
@media (max-width: 480px) {
  html {
    -webkit-text-size-adjust: 100%;
  }
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111827;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-overflow-scrolling: touch;
  }
  .auth-wrapper {
    padding-top: 20px;
    padding-bottom: 20px;
  }
  .auth-card {
    margin: auto;
    max-height: none;
    overflow: visible;
    height: auto;
    border-radius: 20px;
    padding: 24px;
  }
  .welcome-title {
    font-size: 22px;
  }
  .input-group input {
    font-size: 16px;
    padding: 14px 16px;
  }
  .submit-btn {
    font-size: 16px;
    padding: 16px !important;
  }
  .otp-input {
    font-size: 40px;
    letter-spacing: 16px;
    padding: 16px 8px;
  }
}
