/* ========================================
   Register Page Styles - Rewards Management
   ======================================== */

.register-header {
    margin-bottom: 1rem;
}

.register-container {
    width: 520px;
    max-width: 100%;
    margin: 0 auto;
    animation: slideUp 0.6s ease-out;
    font-family: 'MiSans', 'MiSans Thai' !important;
}

.register-card {
    background: #fff;
    border-radius: var(--login-radius, 16px);
    padding: 2.5rem 2rem;
    box-shadow: var(--login-shadow, 0 25px 50px -12px rgba(0, 0, 0, 0.25));
}

/* ---- Step Indicator ---- */
.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.step-line {
    position: absolute;
    top: 18px;
    left: 50px;
    right: 50px;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    z-index: 0;
}

.step-line-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #6366f1);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgb(255 255 255);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgb(18 18 18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s ease;
    margin-bottom: 0.4rem;
}

.step-item.active .step-circle {
    background: linear-gradient(135deg, var(--login-accent, #6366f1), #7c3aed);
    border-color: var(--login-accent, #6366f1);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.step-item.completed .step-circle {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.step-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    white-space: nowrap;
    transition: color 0.3s;
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: rgba(255, 255, 255, 0.85);
}

/* ---- Step Content ---- */
.register-step-content {
    text-align: center;
}

.register-step-content .login-form {
    text-align: left;
}

.step-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--login-accent, #6366f1) 0%, #7c3aed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.register-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--login-text-primary, #0f172a);
    margin-bottom: 0.25rem;
}

.register-subtitle {
    font-size: 0.85rem;
    color: var(--login-text-secondary, #64748b);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.register-subtitle strong {
    color: var(--login-accent, #6366f1);
}

/* ---- Form Helpers ---- */
.form-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--login-text-muted, #94a3b8);
    margin-top: 0.25rem;
}

/* ---- Button Group (Back + Next) ---- */
.register-btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.register-btn-group .btn-back {
    flex: 0 0 auto;
    height: 48px;
    padding: 0 1.25rem;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    color: var(--login-text-secondary, #64748b);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.register-btn-group .btn-back:hover {
    background: #e2e8f0;
    color: var(--login-text-primary, #0f172a);
}

.register-btn-group .btn-login {
    flex: 1;
}

/* ---- Point Rate Box ---- */
.point-rate-box {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.point-rate-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--login-text-primary, #0f172a);
    margin-bottom: 0.75rem;
    text-align: center;
}

.point-rate-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.point-rate-input {
    flex: 1;
    text-align: center;
}

.point-rate-input label {
    display: block;
    font-size: 0.7rem;
    color: var(--login-text-muted, #94a3b8);
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.point-rate-input .form-control {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.point-rate-equal {
    color: var(--login-text-muted, #94a3b8);
    font-size: 0.9rem;
    padding-top: 1rem;
}

.point-rate-preview {
    text-align: center;
    font-size: 0.8rem;
    color: var(--login-text-secondary, #64748b);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.point-rate-preview strong {
    color: var(--login-accent, #6366f1);
}

/* ---- Summary Box ---- */
.register-summary {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.summary-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--login-text-primary, #0f172a);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.8rem;
}

.summary-label {
    color: var(--login-text-muted, #94a3b8);
    font-weight: 500;
}

.summary-value {
    color: var(--login-text-primary, #0f172a);
    font-weight: 600;
}

/* ---- Success Green Gradient Button ---- */
.btn-success-gradient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.btn-success-gradient:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35) !important;
}

/* ---- Done Step ---- */
.register-done {
    padding: 1rem 0;
}

.done-animation {
    margin-bottom: 1.25rem;
}

.done-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35);
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.done-info {
    text-align: left;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

.done-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: #065f46;
}

.done-info-item i {
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.register-done .btn-login {
    display: inline-flex;
    text-decoration: none;
    width: 100%;
}

/* ---- Hero Login Button (Step 5) ---- */
.btn-login-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: heroButtonPulse 2s ease-in-out infinite;
}

.btn-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 30%, #a855f7 50%, #7c3aed 70%, #6366f1 100%);
    background-size: 200% 200%;
    animation: heroGradientShift 3s ease infinite;
    z-index: 0;
}

.btn-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    letter-spacing: 0.03em;
}

.btn-login-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.45), 0 0 20px rgba(139, 92, 246, 0.3);
    color: #fff;
    text-decoration: none;
}

.btn-login-hero:active {
    transform: translateY(0);
}

@keyframes heroGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes heroButtonPulse {
    0%, 100% { box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35); }
    50% { box-shadow: 0 8px 35px rgba(99, 102, 241, 0.55), 0 0 15px rgba(139, 92, 246, 0.25); }
}

/* ---- Done Title Enhancement ---- */
.done-title {
    font-size: 1.6rem;
    background: linear-gradient(135deg, #10b981, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Email Notice (Step 5) ---- */
.done-email-notice {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f4ff 100%);
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    text-align: left;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.done-email-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.done-email-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.done-email-text strong {
    font-size: 0.85rem;
    color: #312e81;
}

.done-email-text span {
    font-size: 0.75rem;
    color: #6366f1;
    line-height: 1.4;
}

.done-login-hint {
    font-size: 0.75rem;
    color: var(--login-text-muted, #94a3b8);
    margin-top: 0.75rem;
    text-align: center;
}

/* ---- Sparkles Animation ---- */
.done-animation {
    position: relative;
    margin-bottom: 1.25rem;
}

.done-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    color: #fbbf24;
    font-size: 0.6rem;
    animation: sparkleFloat 1.5s ease-in-out infinite;
}

.sparkle-1 { top: 5px; left: calc(50% - 55px); animation-delay: 0s; }
.sparkle-2 { top: 5px; right: calc(50% - 55px); animation-delay: 0.4s; }
.sparkle-3 { bottom: 10px; left: calc(50% - 48px); animation-delay: 0.8s; color: #a78bfa; }
.sparkle-4 { bottom: 10px; right: calc(50% - 48px); animation-delay: 1.2s; color: #34d399; }

@keyframes sparkleFloat {
    0%, 100% { opacity: 0.3; transform: scale(0.7) translateY(0); }
    50% { opacity: 1; transform: scale(1.1) translateY(-6px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Confetti Canvas */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ---- Password strength (reuse from forgot-password) ---- */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.password-strength.visible { opacity: 1; }

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: #e2e8f0;
    transition: background 0.3s ease;
}

.strength-bar.weak { background: #ef4444; }
.strength-bar.fair { background: #f59e0b; }
.strength-bar.good { background: #3b82f6; }
.strength-bar.strong { background: #10b981; }

.strength-text {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

.strength-text.weak { color: #ef4444; }
.strength-text.fair { color: #f59e0b; }
.strength-text.good { color: #3b82f6; }
.strength-text.strong { color: #10b981; }

.match-indicator {
    font-size: 0.75rem;
    margin-top: 0.3rem;
    display: none;
}
.match-indicator.show { display: block; }
.match-indicator.match { color: #10b981; }
.match-indicator.mismatch { color: #ef4444; }

/* ---- Inline Validation ---- */
.form-group .validation-msg {
    font-size: 0.72rem;
    margin-top: 0.3rem;
    display: none;
    align-items: center;
    gap: 0.3rem;
    line-height: 1.4;
    animation: fadeInMsg 0.25s ease;
}

.form-group .validation-msg.visible {
    display: flex;
}

.form-group .validation-msg.error {
    color: #ef4444;
}

.form-group .validation-msg.success {
    color: #10b981;
}

.form-group .validation-msg.pending {
    color: #6366f1;
}

.form-group .validation-msg i {
    font-size: 0.7rem;
    flex-shrink: 0;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Input border states */
.form-group .input-wrapper.has-error .form-control {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-group .input-wrapper.has-error .input-icon {
    color: #ef4444 !important;
}

.form-group .input-wrapper.has-success .form-control {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.form-group .input-wrapper.has-success .input-icon {
    color: #10b981 !important;
}

.form-group .input-wrapper.has-pending .form-control {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.form-group .input-wrapper.has-pending .input-icon {
    color: #6366f1 !important;
}

/* Shake animation for error */
@keyframes shakeField {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.form-group .input-wrapper.shake {
    animation: shakeField 0.4s ease;
}

/* Disable submit when form has errors */
.btn-login.btn-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .register-container {
        max-width: 100%;
    }

    .register-card {
        padding: 1.5rem 1.25rem;
    }

    .step-label {
        font-size: 0.6rem;
    }

    .step-circle {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .point-rate-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .point-rate-equal {
        padding-top: 0;
        transform: rotate(90deg);
    }

    .register-btn-group {
        flex-direction: column-reverse;
    }

    .register-btn-group .btn-back {
        width: 100%;
    }
}
