/* ============================================
   Custom Auth Modal — Resha Rugs
   Colors: #0d0625 (dark navy), #e1bc92 (gold)
   ============================================ */

/* Overlay */
.resha-auth-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 6, 37, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.resha-auth-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal Container */
.resha-auth-modal {
    background: #fff;
    border-radius: 16px;
    width: 420px;
    max-width: 94vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(13, 6, 37, 0.35);
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.resha-auth-overlay.active .resha-auth-modal {
    transform: translateY(0) scale(1);
}

/* Close Button */
.resha-auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(13, 6, 37, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 20;
}

.resha-auth-close:hover {
    background: rgba(13, 6, 37, 0.12);
    transform: rotate(90deg);
}

.resha-auth-close svg {
    width: 16px;
    height: 16px;
    stroke: #0d0625;
    stroke-width: 2.5;
}

/* Header Section */
.resha-auth-header {
    padding: 32px 32px 0;
    text-align: center;
}

.resha-auth-header .auth-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0d0625, #1a103d);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(13, 6, 37, 0.2);
}

.resha-auth-header .auth-icon svg {
    width: 26px;
    height: 26px;
    stroke: #e1bc92;
    fill: none;
    stroke-width: 1.5;
}

.resha-auth-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #0d0625;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.resha-auth-header p {
    font-size: 14px;
    color: #777;
    margin: 0;
    line-height: 1.5;
}

/* Body / Steps */
.resha-auth-body {
    padding: 24px 32px 32px;
    position: relative;
    overflow: hidden;
}

/* Step containers */
.resha-auth-step {
    display: none;
    animation: reshFadeIn 0.35s ease forwards;
}

.resha-auth-step.active {
    display: block;
}

@keyframes reshFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Group */
.resha-input-group {
    margin-bottom: 18px;
}

.resha-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #0d0625;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.resha-input-group input[type="email"],
.resha-input-group input[type="text"],
.resha-input-group input[type="password"],
.resha-input-group input[type="tel"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e8e5ef;
    border-radius: 10px;
    font-size: 15px;
    color: #0d0625;
    background: #fafafe;
    transition: all 0.25s ease;
    outline: none;
    box-sizing: border-box;
}

.resha-input-group input:focus {
    border-color: #e1bc92;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(225, 188, 146, 0.12);
}

.resha-input-group input::placeholder {
    color: #b5b0c3;
}

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

.resha-password-wrap input {
    padding-right: 48px !important;
}

.resha-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    transition: color 0.2s;
}

.resha-password-toggle:hover {
    color: #0d0625;
}

/* OTP Input Group */
.resha-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 16px 0 20px;
}

.resha-otp-inputs input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #0d0625;
    border: 2px solid #e8e5ef;
    border-radius: 10px;
    background: #fafafe;
    transition: all 0.25s ease;
    outline: none;
}

.resha-otp-inputs input:focus {
    border-color: #e1bc92;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(225, 188, 146, 0.15);
    transform: translateY(-2px);
}

.resha-otp-inputs input.filled {
    border-color: #0d0625;
    background: #f5f3fa;
}

/* Primary Button */
.resha-btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0d0625 0%, #1a103d 100%);
    color: #e1bc92;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.resha-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(13, 6, 37, 0.3);
}

.resha-btn-primary:active {
    transform: translateY(0);
}

.resha-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading state */
.resha-btn-primary .btn-text {
    transition: opacity 0.2s;
}

.resha-btn-primary.loading .btn-text {
    opacity: 0;
}

.resha-btn-primary .btn-spin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(225, 188, 146, 0.3);
    border-top-color: #e1bc92;
    border-radius: 50%;
    display: none;
    animation: reshSpin 0.6s linear infinite;
}

.resha-btn-primary.loading .btn-spin {
    display: block;
}

@keyframes reshSpin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Secondary / Link Buttons */
.resha-btn-link {
    background: none;
    border: none;
    color: #e1bc92;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s;
    text-decoration: none;
}

.resha-btn-link:hover {
    color: #c9a06e;
}

/* Divider */
.resha-divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    gap: 12px;
}

.resha-divider::before,
.resha-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e5ef;
}

.resha-divider span {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* OTP Preview (simulation) */
.resha-otp-preview {
    background: linear-gradient(135deg, #fdf8f0, #fef5e7);
    border: 1px dashed #e1bc92;
    border-radius: 8px;
    padding: 10px 16px;
    text-align: center;
    font-size: 13px;
    color: #0d0625;
    margin-bottom: 16px;
}

.resha-otp-preview strong {
    color: #e1bc92;
    font-size: 18px;
    letter-spacing: 4px;
    display: block;
    margin-top: 4px;
}

.resha-otp-preview small {
    display: block;
    margin-top: 4px;
    color: #999;
    font-size: 11px;
}

/* Checkbox styled */
.resha-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 20px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.resha-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #e1bc92;
    cursor: pointer;
}

/* Error / Success Messages */
.resha-auth-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    animation: reshFadeIn 0.3s ease;
}

.resha-auth-message.error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
}

.resha-auth-message.success {
    display: block;
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    color: #15803d;
}

/* Success Checkmark */
.resha-success-anim {
    text-align: center;
    padding: 20px 0;
}

.resha-success-anim .check-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d0625, #1a103d);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: reshPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.resha-success-anim .check-circle svg {
    width: 32px;
    height: 32px;
    stroke: #e1bc92;
    stroke-width: 2.5;
    fill: none;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: reshCheckDraw 0.5s 0.3s ease forwards;
}

@keyframes reshPopIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes reshCheckDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.resha-success-anim h3 {
    color: #0d0625;
    font-size: 20px;
    margin: 0 0 6px;
}

.resha-success-anim p {
    color: #777;
    font-size: 14px;
    margin: 0;
}

/* Back link */
.resha-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #999;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.resha-back-link:hover {
    color: #0d0625;
}

.resha-back-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Resend OTP */
.resha-resend-wrap {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #999;
}

.resha-resend-wrap button {
    background: none;
    border: none;
    color: #e1bc92;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: 13px;
}

.resha-resend-wrap button:disabled {
    color: #ccc;
    cursor: not-allowed;
    text-decoration: none;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .resha-auth-modal {
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }

    .resha-auth-overlay.active {
        align-items: flex-end;
    }

    .resha-auth-header {
        padding: 28px 24px 0;
    }

    .resha-auth-body {
        padding: 20px 24px 28px;
    }

    .resha-otp-inputs input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
}