/* ============================================================
   APP.CSS - Global resets and Blazor-specific overrides.
   Design tokens, components, layout and utilities are imported
   below so they load after synapse.css (cascade order matters).
   ============================================================ */

@import 'legacy-tokens.css';
@import 'components.css';
@import 'layout.css';
@import 'utilities.css';

/* ── Global reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #F9FAFB;
    overflow-x: hidden;
    max-width: 100vw;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBh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ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: #c02d76;
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
    text-align: start;
}

.error-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.75rem;
    color: #fca5a5;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.error-alert svg {
    flex-shrink: 0;
    color: #f87171;
}

.user-greeting {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

/* Add to your auth styles */
.success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.verification-instructions {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.verification-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resend-message {
    text-align: center;
    font-size: 0.875rem;
    margin: 0;
}

.resend-message.success {
    color: #10b981;
}

.resend-message.error {
    color: #ef4444;
}

/* ============================================
   REGISTER PAGE ANIMATIONS
   ============================================ */

/* ===== FORM EXIT ANIMATION ===== */
.auth-card.form-exit {
    animation: formExit 0.3s ease-out forwards;
}

@keyframes formExit {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    100% {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
}

/* ===== VERIFICATION SUCCESS CARD ===== */
.verification-success-card {
    animation: cardEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cardEnter {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== LOADING STATE ===== */
.verification-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.verification-spinner-container {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.verification-spinner {
    width: 100%;
    height: 100%;
    animation: spinnerRotate 1.5s linear infinite;
}

@keyframes spinnerRotate {
    100% {
        transform: rotate(360deg);
    }
}

.spinner-track {
    stroke: rgba(99, 102, 241, 0.15);
}

.spinner-progress {
    stroke: #6366f1;
    stroke-linecap: round;
    stroke-dasharray: 125.6;
    stroke-dashoffset: 94.2;
    animation: spinnerDash 1.5s ease-in-out infinite;
}

@keyframes spinnerDash {
    0% {
        stroke-dashoffset: 94.2;
        transform: rotate(0deg);
    }

    50% {
        stroke-dashoffset: 31.4;
        transform: rotate(45deg);
    }

    100% {
        stroke-dashoffset: 94.2;
        transform: rotate(360deg);
    }
}

.verification-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    text-align: center;
}

.verification-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
    text-align: center;
}

/* ===== SUCCESS STATE ANIMATIONS ===== */
.verification-success-animated {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
}

/* Success Icon Container */
.success-icon-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
}

.success-icon-bg,
.email-icon-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(99, 102, 241, 0.2));
    border-radius: 50%;
    animation: iconBgPulse 2s ease-in-out infinite;
}

@keyframes iconBgPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* Email Icon Animation */
.success-checkmark,
.email-checkmark {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.checkmark-circle {
    stroke: #10b981;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: circleIn 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.2s forwards;
}

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

/* Email envelope animation */
.email-icon-group {
    animation: emailIconIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}

@keyframes emailIconIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(5px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.email-envelope {
    stroke: #10b981;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: envelopeDraw 0.8s ease-out 0.6s forwards;
}

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

.email-flap {
    stroke: #10b981;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: flapDraw 0.5s ease-out 1s forwards;
}

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

/* Title and text animations */
.verification-success-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.75rem;
    text-align: center;
    animation: textSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

.verification-success-text {
    font-size: 1rem;
    color: #94a3b8;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    animation: textSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

.email-highlight {
    color: #6366f1;
    font-weight: 600;
}

@keyframes textSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Instructions animation */
.verification-instructions-animated {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    width: 100%;
    animation: instructionsIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}

.verification-instructions-animated p {
    font-size: 0.875rem;
    color: #cbd5e1;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

@keyframes instructionsIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Action buttons animation */
.verification-actions-animated {
    width: 100%;
    margin-bottom: 1rem;
    animation: actionsIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

@keyframes actionsIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.resend-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.resend-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Resend message container */
.resend-message-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    animation: messageIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.resend-message-container.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.resend-message-container.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

@keyframes messageIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Redirect button animation */
.redirect-btn {
    animation: redirectBtnIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s both;
}

@keyframes redirectBtnIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ERROR STATE ===== */
.verification-error-animated {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    animation: errorIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes errorIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.error-icon-container {
    margin-bottom: 1.5rem;
    animation: errorIconShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) 0.3s;
}

@keyframes errorIconShake {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}

.verification-error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 0.75rem;
    text-align: center;
}

.verification-error-text {
    font-size: 0.875rem;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ===== REDIRECT PROGRESS ===== */
.redirect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    animation: redirectContainerIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

@keyframes redirectContainerIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.redirect-progress-ring {
    position: relative;
    width: 48px;
    height: 48px;
}

.redirect-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.redirect-progress-bg {
    stroke: rgba(99, 102, 241, 0.2);
}

.redirect-progress-bar {
    stroke: #6366f1;
    stroke-linecap: round;
    stroke-dasharray: 100.53;
    transition: stroke-dashoffset 1s linear;
}

.redirect-countdown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: #6366f1;
}

.redirect-text {
    font-size: 0.875rem;
    color: #94a3b8;
}

.redirect-text strong {
    color: #6366f1;
}

/* ===== LOADING SPINNER (small, for buttons) ===== */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 480px) {
    .success-icon-container {
        width: 80px;
        height: 80px;
    }

    .verification-success-title {
        font-size: 1.5rem;
    }

    .verification-success-text {
        font-size: 0.875rem;
    }

    .verification-instructions-animated {
        padding: 0.875rem 1rem;
    }
}

/* ============================================
   STEP 3 - CHECK YOUR INBOX (GREEN THEME)
   ============================================ */

/* Exit animation for form */
.auth-card.transitioning-out {
    animation: slideOutLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutLeft {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(-30px) scale(0.98);
    }
}

/* Success step indicator (green) */
.step-indicator .step.success {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.step-indicator .step-line.success {
    background: linear-gradient(90deg, #6366f1, #10b981);
}

.step-indicator .step-line.success.active {
    background: linear-gradient(90deg, #6366f1, #10b981);
}

/* Step 3 Header Styles */
.step3-header {
    animation: textSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.step3-title {
    color: #10b981 !important;
}

.step3-subtitle {
    animation: textSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

.email-highlight-green {
    color: #10b981;
    font-weight: 600;
}

/* Email Icon Animation */
.email-icon-animated {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: emailIconScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes emailIconScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.email-icon-bg-animated {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    border-radius: 50%;
    animation: iconBgPulseGreen 2s ease-in-out infinite;
}

@keyframes iconBgPulseGreen {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.6;
    }
}

.email-svg-animated {
    position: relative;
    z-index: 1;
}

.email-envelope-animated {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: envelopeDrawIn 0.8s ease-out 0.5s forwards;
}

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

.email-flap-animated {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: flapDrawIn 0.5s ease-out 0.9s forwards;
}

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

/* Step 3 Instructions */
.step3-instructions {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    animation: instructionsSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

@keyframes instructionsSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step 3 Actions */
.step3-actions {
    animation: actionsSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}

@keyframes actionsSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Green outline button for step 3 */
.btn-success-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 0.75rem;
    color: #10b981;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-success-outline:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success-outline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Green spinner */
.spinner-green {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}