/* Refer2Bundle auth look — self-contained (no Tailwind CDN required) */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body.auth-body {
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: #1f2937;
    background: linear-gradient(135deg, #F5F0FF 0%, #F0F4FF 50%, #FFF9F0 100%);
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

body.auth-body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, 80vw);
    height: min(520px, 80vw);
    background: url('/images/logo.jpeg') center/contain no-repeat;
    opacity: 0.035;
    pointer-events: none;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.glass-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 28rem;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.16);
    opacity: 1;
    transform: none;
}

@media (min-width: 768px) {
    .glass-card { padding: 2.5rem; }
}

.auth-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-logo-ring {
    width: 7rem;
    height: 7rem;
    border-radius: 9999px;
    background: linear-gradient(to bottom right, #dc2626, #991b1b);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.35);
}

.auth-logo-ring img {
    width: 6.5rem;
    height: 6.5rem;
    border-radius: 9999px;
    object-fit: cover;
    display: block;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.875rem;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
}

.auth-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.auth-pane { display: none; }
.auth-pane.active { display: block; }

.hidden,
[hidden],
.auth-tab.hidden {
    display: none !important;
}

.auth-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.input-wrap {
    position: relative;
}

.input-wrap .icon-left,
.input-wrap .icon-right {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    color: #9ca3af;
    z-index: 1;
}

.input-wrap .icon-left {
    left: 0;
    padding-left: 0.875rem;
    pointer-events: none;
}

.input-wrap .icon-right {
    right: 0;
    padding-right: 0.875rem;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.input-wrap .icon-left svg,
.input-wrap .icon-right svg,
.input-wrap .icon-left i,
.input-wrap .icon-right i {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    color: #111827;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input.with-toggle { padding-right: 2.75rem; }

.auth-input:focus {
    outline: none;
    border-color: #dc2626;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

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

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
    cursor: pointer;
}

.auth-check input {
    width: 1rem;
    height: 1rem;
    accent-color: #dc2626;
}

.auth-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc2626;
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.auth-link:hover { color: #b91c1c; }

.auth-btn-primary {
    width: 100%;
    padding: 0.8rem 1rem;
    background: linear-gradient(to right, #dc2626, #991b1b);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    border-radius: 0.75rem;
    border: 0;
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.3);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.auth-btn-primary:hover {
    background: linear-gradient(to right, #b91c1c, #7f1d1d);
    transform: translateY(-1px);
    box-shadow: 0 12px 18px -3px rgba(220, 38, 38, 0.4);
}

.auth-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-ghost {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: inherit;
    border-radius: 0.75rem;
    cursor: pointer;
}

.auth-btn-ghost:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.auth-footer-note {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.auth-footer-note .auth-link,
.auth-footer-note button.auth-link {
    font-weight: 600;
}

.auth-admin-note {
    margin: 0.75rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

.auth-error {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-success {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #9ca3af;
}

.auth-alert {
    margin-bottom: 1rem;
    padding: 0.75rem 0.875rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.75rem;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.auth-alert svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.1rem; }

.page-footer {
    position: relative;
    z-index: 10;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.page-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.5rem;
}

.page-footer a {
    color: #6b7280;
    text-decoration: none;
}

.page-footer a:hover { color: #111827; }

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.step-indicator {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #e5e7eb;
    color: #6b7280;
}

.step-indicator.active,
.step-indicator.done {
    background: #dc2626;
    color: #fff;
}

.step-indicator.success {
    background: #22c55e;
    color: #fff;
}

.step-indicator svg { width: 1rem; height: 1rem; }

.step-line {
    width: 2.5rem;
    height: 2px;
    background: #e5e7eb;
    transition: background 0.3s ease;
}

.step-line.active { background: #dc2626; }

.signup-step.hidden { display: none !important; }

.strength-bars {
    display: flex;
    gap: 0.25rem;
    margin: 0.5rem 0 0.35rem;
}

.strength-bar {
    height: 0.375rem;
    flex: 1;
    border-radius: 9999px;
    background: #e5e7eb;
    transition: background 0.3s ease;
}

.strength-bar.s1 { background: #f87171; }
.strength-bar.s2 { background: #fb923c; }
.strength-bar.s3 { background: #facc15; }
.strength-bar.s4 { background: #22c55e; }

#strength-text {
    margin: 0;
    font-size: 0.75rem;
    color: #9ca3af;
}

.confirm-box {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.confirm-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.confirm-row svg {
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.back-text-btn {
    margin-top: 0.75rem;
    width: 100%;
    background: none;
    border: 0;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
}

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

.back-link {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.back-link a,
.back-link button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
}

.back-link a:hover,
.back-link button:hover { color: #111827; }

.back-link svg { width: 1rem; height: 1rem; }

/* OTP */
.otp-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.otp-input {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    caret-color: #dc2626;
    font-family: inherit;
}

.otp-input:focus {
    outline: none;
    border-color: #dc2626;
    background: #fff;
}

.otp-input.filled {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

.otp-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: linear-gradient(to bottom right, #fee2e2, #fecaca);
    border-radius: 1rem;
    margin-bottom: 1rem;
    color: #dc2626;
}

.otp-icon-wrap svg { width: 2rem; height: 2rem; }

.info-box {
    background: rgba(254, 242, 242, 0.85);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #991b1b;
}

.info-box svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #dc2626;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.success-state {
    text-align: center;
    padding: 1rem 0;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 9999px;
    background: linear-gradient(to bottom right, #d1fae5, #a7f3d0);
    color: #16a34a;
    margin-bottom: 1rem;
}

.success-icon svg { width: 2.5rem; height: 2.5rem; }

.turnstile-wrap {
    display: flex;
    justify-content: center;
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: -0.15em;
    margin-right: 0.35rem;
}

#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.15);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideUp 0.35s ease-out;
}

.toast.success { background: #22c55e; }
.toast.error { background: #ef4444; }
.toast svg { width: 1.25rem; height: 1.25rem; }

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.overlay.show { display: flex; }

.overlay .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 420px) {
    .glass-card { padding: 1.5rem 1.15rem; }
    .auth-header h1 { font-size: 1.5rem; }
    .step-line { width: 1.5rem; }
    .otp-input { width: 2.6rem; height: 3.1rem; font-size: 1.25rem; }
}
