/* Auth Pages Styles - SibmainMiners */
/* Blue primary, orange secondary */

:root {
    --primary: #1a5fb4;
    --primary-dark: #144a8f;
    --primary-light: #3d8fd9;
    --secondary: #e8611a;
    --secondary-dark: #c7510f;
    --secondary-light: #fff4ed;
    --accent: #e8611a;
    --dark: #1a2332;
    --light: #ffffff;
    --gray: #6c757d;
    --gray-light: #f8f9fb;
    --blue-gradient: linear-gradient(135deg, #1a2332 0%, #1a5fb4 100%);
    --orange-gradient: linear-gradient(135deg, #e8611a 0%, #f5a623 100%);
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f0f7ff;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--site-bg-image, none) center center / cover no-repeat;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    z-index: 10;
}

/* Page Loader (auth) */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.35s ease;
}
.loader-content { text-align: center; }
.loader-favicon-ring {
    width: 88px;
    height: 88px;
    margin: 0 auto 18px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader-favicon-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid #e8f4fc;
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    animation: loaderRingSpin 0.9s linear infinite;
}
.loader-favicon-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    animation: loaderFaviconPulse 1.2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}
@keyframes loaderRingSpin { to { transform: rotate(360deg); } }
@keyframes loaderFaviconPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.06) rotate(8deg); }
}
.loader-content p { color: var(--gray); font-weight: 600; font-size: 14px; }

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.auth-card.register-card {
    max-width: 480px;
    overflow: visible;
}

.auth-container.register-container {
    max-width: 480px;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo-img {
    max-width: 140px;
    height: auto;
    animation: pulse 2s infinite;
}

.version-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 5px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 223, 163, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-container h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.tagline {
    color: var(--gray);
    font-size: 14px;
    margin: 0;
}

.auth-form {
    margin-top: 20px;
}

.form-floating {
    position: relative;
    margin-bottom: 20px;
}

.form-floating > .form-control {
    height: 56px;
    padding: 24px 16px 8px 45px;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    font-size: 15px;
    background: var(--light);
    transition: all 0.3s ease;
}

.form-floating > .form-control::placeholder {
    color: transparent;
}

.form-floating > .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 223, 163, 0.1);
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 16px 16px 16px 45px;
    pointer-events: none;
    border: 2px solid transparent;
    transform-origin: 0 0;
    transition: opacity .1s ease-in-out, transform .1s ease-in-out;
    color: var(--gray);
    font-size: 14px;
}

.form-floating .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    z-index: 5;
    transition: color 0.3s ease;
}

.form-floating > .form-control:focus ~ .input-icon {
    color: var(--primary);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    background: white;
    padding: 0 5px;
    height: auto;
    left: 40px;
    top: 0;
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray);
    z-index: 10;
    padding: 5px;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Compact Back Button */
.btn-back {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
    border: 2px solid #e9ecef;
    background: transparent;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 223, 163, 0.05);
    transform: translateX(-3px);
}

.btn-back:active {
    transform: translateX(-3px) scale(0.95);
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 5px;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    font-size: 14px;
    color: var(--gray);
    margin-left: 5px;
}

.forgot-link {
    font-size: 14px;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.btn-auth {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    background: linear-gradient(135deg, #1a5fb4, #144a8f);
    color: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(26, 95, 180, 0.35);
    color: white;
}

.btn-auth:disabled {
    opacity: 0.7;
    transform: none;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.auth-footer p {
    color: var(--gray);
    font-size: 14px;
    margin: 0;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Floating Coins Animation */
.crypto-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-coin {
    position: absolute;
    font-size: 24px;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.coin-1 {
    top: 10%;
    left: 10%;
    color: #f7931a;
    animation-delay: 0s;
}

.coin-2 {
    top: 60%;
    right: 10%;
    color: #627eea;
    animation-delay: 2s;
}

.coin-3 {
    bottom: 20%;
    left: 20%;
    color: var(--accent);
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

/* Background Shapes */
.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: morph 15s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
    animation: morph 12s ease-in-out infinite reverse;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: morph 10s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

/* Step Indicator */
.step-header {
    margin-bottom: 25px;
}

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

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step-number.active {
    background: var(--primary);
    color: white;
}

.step-number.completed {
    background: var(--primary);
    color: white;
}

.step-line {
    width: 60px;
    height: 3px;
    background: #e9ecef;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.step-line.active {
    background: var(--primary);
}

.step-header h5 {
    text-align: center;
    color: var(--dark);
    font-weight: 600;
    margin: 0;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Sponsor Info Card */
.sponsor-info {
    margin-bottom: 20px;
}

.sponsor-card {
    background: rgba(0, 223, 163, 0.1);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
    font-weight: 500;
}

.sponsor-card i {
    font-size: 20px;
}

/* Forgot Password Icon */
.forgot-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--secondary), #e62e56);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
}

.forgot-icon.success {
    background: linear-gradient(135deg, var(--primary), #00c896);
}

/* Select Styling */
.form-floating > select.form-control {
    padding-top: 20px;
}

/* SweetAlert Custom */
.swal-custom {
    border-radius: 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif !important;
}

/* Modal Styling */
.modal-content {
    border-radius: 20px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding: 20px 24px;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-body h6 {
    color: var(--dark);
    font-weight: 600;
    margin-top: 15px;
}

.modal-body p {
    color: var(--gray);
    font-size: 14px;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 16px 24px;
}

/* Register form extras */
.phone-input-group {
    display: flex;
    gap: 10px;
}

.phone-code {
    width: 100px;
    flex-shrink: 0;
}

.phone-number {
    flex: 1;
    min-width: 0;
}

.otp-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
    flex-wrap: nowrap;
}

.otp-input {
    flex: 1;
    max-width: 48px;
    min-width: 0;
    height: 48px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s;
}

.otp-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 95, 180, 0.15);
}

.otp-timer {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin-top: 8px;
}

.otp-timer span {
    color: var(--secondary);
    font-weight: 600;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
}

.resend-btn:disabled {
    color: #999;
    cursor: not-allowed;
    text-decoration: none;
}

.email-verified-badge {
    display: none;
    align-items: center;
    gap: 5px;
    background: #d4edda;
    color: #155724;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-top: 10px;
}

.email-verified-badge.show {
    display: inline-flex;
}

.sponsor-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.sponsor-row .form-floating {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.btn-verify-sponsor {
    flex-shrink: 0;
    height: 56px;
    min-width: 96px;
    padding: 0 18px;
    border: 2px solid #c5daf5;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #eef4fc 100%);
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    box-shadow: 0 2px 6px rgba(26, 95, 180, 0.08);
}

.btn-verify-sponsor:hover:not(:disabled):not(.verified) {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(26, 95, 180, 0.28);
    transform: translateY(-1px);
}

.btn-verify-sponsor:active:not(:disabled):not(.verified) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26, 95, 180, 0.15);
}

.btn-verify-sponsor:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn-verify-sponsor.verified {
    min-width: 56px;
    width: 56px;
    padding: 0;
    background: #ecfdf5;
    border-color: #34d399;
    color: #047857;
    box-shadow: none;
    transform: none;
}

.btn-verify-sponsor.verified i {
    font-size: 16px;
}

.btn-send-otp {
    width: 100%;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: 10px;
    font-size: 14px;
    margin-top: 4px;
}

.btn-send-otp:hover:not(:disabled) {
    background: var(--primary-dark);
}

.otp-section {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e9ecef;
}

.otp-section.show {
    display: block;
}

/* Responsive */
@media (max-width: 767.98px) {
    .auth-wrapper {
        align-items: flex-start;
        padding: 16px 12px 32px;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-container,
    .auth-container.register-container {
        max-width: 100%;
        width: 100%;
    }

    .auth-card {
        padding: 28px 18px 24px;
        border-radius: 20px;
    }

    .auth-header {
        margin-bottom: 22px;
    }

    .logo-img {
        max-width: 120px;
    }

    .tagline {
        font-size: 13px;
    }

    .form-floating > .form-control,
    .form-floating > select.form-control {
        font-size: 16px;
    }

    .btn-auth {
        min-height: 48px;
    }

    .crypto-animation {
        display: none;
    }

    .auth-bg .bg-shape {
        opacity: 0.35;
        filter: blur(60px);
    }

    .shape-1 {
        width: 260px;
        height: 260px;
    }

    .shape-2 {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 576px) {
    .auth-wrapper {
        padding: 12px 10px 28px;
    }

    .auth-card {
        padding: 24px 16px 20px;
        border-radius: 18px;
    }

    .auth-card.register-card {
        padding-bottom: 24px;
    }

    .logo-container h1 {
        font-size: 24px;
    }

    .logo-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .sponsor-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .btn-verify-sponsor {
        width: 100%;
        min-width: unset;
        height: 52px;
    }

    .btn-verify-sponsor.verified {
        width: 100%;
        min-width: unset;
    }

    .phone-input-group {
        flex-direction: column;
        gap: 10px;
    }

    .phone-code {
        width: 100%;
    }

    .otp-input-group {
        gap: 5px;
    }

    .otp-input {
        max-width: none;
        height: 44px;
        font-size: 16px;
        border-radius: 8px;
    }

    .form-check-label {
        font-size: 13px;
        line-height: 1.45;
    }

    .auth-footer p {
        font-size: 14px;
    }

    .modal-body {
        padding: 18px;
    }

    .modal-header,
    .modal-footer {
        padding: 14px 18px;
    }
}

@media (max-width: 380px) {
    .otp-input-group {
        gap: 4px;
    }

    .otp-input {
        height: 40px;
        font-size: 15px;
    }
}
