/* ============================================================
   AUTH PAGES (Login & Register) — Styles
   Extends: app.css (Design System)
   ============================================================ */

/* ============================================================
   PAGE LAYOUT — Full-screen auth wrapper
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    position: relative;
    overflow: hidden;
}

/* Decorative background — subtle petals */
.auth-page__bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.auth-bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
}

.auth-bg-blob--1 {
    width: 340px;
    height: 340px;
    background: radial-gradient(
        circle,
        rgba(244, 167, 185, 0.5) 0%,
        transparent 70%
    );
    top: -100px;
    right: -80px;
    animation: blob-drift 12s ease-in-out infinite alternate;
}

.auth-bg-blob--2 {
    width: 280px;
    height: 280px;
    background: radial-gradient(
        circle,
        rgba(212, 115, 138, 0.28) 0%,
        transparent 70%
    );
    bottom: -80px;
    left: -60px;
    animation: blob-drift 15s ease-in-out infinite alternate-reverse;
}

.auth-bg-blob--3 {
    width: 160px;
    height: 160px;
    background: radial-gradient(
        circle,
        rgba(244, 167, 185, 0.3) 0%,
        transparent 70%
    );
    top: 45%;
    left: -40px;
    animation: blob-drift 9s ease-in-out infinite alternate;
}

@keyframes blob-drift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(20px, 16px) scale(1.06);
    }
}

/* Petal decorations */
.auth-petal {
    position: absolute;
    font-size: 28px;
    opacity: 0.12;
    pointer-events: none;
    animation: petal-spin 20s linear infinite;
}

@keyframes petal-spin {
    from {
        transform: rotate(0deg) translateY(0);
    }
    to {
        transform: rotate(360deg) translateY(-10px);
    }
}

/* ============================================================
   SCROLLABLE CONTENT
   ============================================================ */
.auth-scroll {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg) var(--space-2xl);
    min-height: 100vh;
}

/* ============================================================
   BRAND / LOGO SECTION
   ============================================================ */
.auth-brand {
    text-align: center;
    margin-bottom: var(--space-xl);
    animation: auth-fade-up 0.5s ease both;
}

.auth-brand__logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    background: linear-gradient(
        135deg,
        var(--color-primary-dark),
        var(--color-primary)
    );

    border-radius: 14px;

    margin-bottom: 14px;

    box-shadow: 0 6px 18px rgba(212, 115, 138, 0.22);

    overflow: hidden;

    animation: logo-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.auth-brand__logo-wrap img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

@keyframes logo-pop {
    from {
        transform: scale(0.78) rotate(-6deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.auth-brand__name {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-dark);

    letter-spacing: -0.4px;
    line-height: 1.1;

    margin-bottom: 4px;
}

.auth-brand__name span {
    color: var(--color-primary-dark);
}

.auth-brand__tagline {
    font-size: 13px;
    color: var(--color-text-muted);

    font-weight: 500;
    margin-top: 4px;

    letter-spacing: 0.3px;
    opacity: 0.85;
}

/* ============================================================
   AUTH CARD
   ============================================================ */
.auth-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow:
        var(--shadow-md),
        0 0 0 1px rgba(244, 167, 185, 0.08) inset;
    padding: var(--space-xl) var(--space-lg);
    animation: auth-fade-up 0.5s 0.08s ease both;
}

@keyframes auth-fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Title inside card */
.auth-card__title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    line-height: 1.25;
}

.auth-card__subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin-bottom: var(--space-xl);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-form-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding-left: 2px;
}

/* Input wrapper (for icon) */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 15px;
    font-size: 16px;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
    z-index: 1;
}

.auth-input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text-dark);
    background: var(--color-bg-section);
    outline: none;
    transition:
        border-color var(--transition-base),
        background var(--transition-base),
        box-shadow var(--transition-base);
    -webkit-appearance: none;
}

.auth-input::placeholder {
    color: var(--color-text-muted);
    font-weight: 400;
}

.auth-input:focus {
    border-color: var(--color-primary);
    background: var(--color-white);
    box-shadow: 0 0 0 4px rgba(244, 167, 185, 0.15);
}

.auth-input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--color-primary-dark);
}

/* Input error state */
.auth-input.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.auth-input.valid {
    border-color: #2ecc71;
}

/* Password toggle button */
.auth-input-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 17px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
    border-radius: var(--radius-sm);
}

.auth-input-toggle:hover {
    color: var(--color-text-dark);
}

/* Password strength bar */
.pwd-strength {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    height: 3px;
}

.pwd-strength__bar {
    flex: 1;
    height: 100%;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background 0.3s ease;
}

.pwd-strength__bar.weak {
    background: #dc2626;
}
.pwd-strength__bar.medium {
    background: #f39c12;
}
.pwd-strength__bar.strong {
    background: #2ecc71;
}

.pwd-strength-label {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
    height: 14px;
    transition: color 0.3s ease;
}

/* Field error message */
.auth-field-error {
    font-size: 12px;
    color: #dc2626;
    font-weight: 500;
    display: none;
    padding-left: 2px;
    animation: auth-fade-up 0.2s ease both;
}

.auth-field-error.visible {
    display: block;
}

/* Forgot password link (row) */
.auth-form-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: -var(--space-sm);
}

.auth-forgot {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary-dark);
    text-decoration: none;
    border: none;
    background: none;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 2px 0;
    transition: opacity var(--transition-fast);
}

.auth-forgot:hover {
    opacity: 0.75;
}

/* ============================================================
   AUTH PRIMARY BUTTON
   ============================================================ */
.auth-btn {
    width: 100%;
    padding: 15px var(--space-lg);
    background: linear-gradient(
        135deg,
        var(--color-primary-dark) 0%,
        var(--color-primary) 100%
    );
    color: white;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 800;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(212, 115, 138, 0.35);
    transition: all var(--transition-fast);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    margin-top: var(--space-sm);
}

/* Shimmer sweep on the button */
.auth-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.18),
        transparent
    );
    animation: btn-sweep 3.5s ease-in-out infinite;
}

@keyframes btn-sweep {
    0%,
    40% {
        left: -100%;
    }
    80%,
    100% {
        left: 160%;
    }
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 32px rgba(212, 115, 138, 0.42);
}

.auth-btn:active {
    transform: scale(0.975);
    box-shadow: 0 4px 16px rgba(212, 115, 138, 0.28);
}

/* Loading state */
.auth-btn.loading {
    pointer-events: none;
    opacity: 0.82;
}

.auth-btn.loading::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* ============================================================
   OR DIVIDER
   ============================================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.auth-divider__line {
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.auth-divider__text {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.5px;
}

/* ============================================================
   SOCIAL LOGIN
   ============================================================ */
.auth-social {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.auth-social-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px var(--space-lg);
    background: var(--color-white);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
    text-decoration: none;
}

.auth-social-btn:hover {
    border-color: var(--color-primary-light);
    background: var(--color-bg-section);
}

.auth-social-btn:active {
    transform: scale(0.97);
}

.auth-social-btn__icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ============================================================
   REDIRECT LINK (Login ↔ Register)
   ============================================================ */
.auth-redirect {
    text-align: center;
    margin-top: var(--space-xl);
    font-size: 14px;
    color: var(--color-text-muted);
    animation: auth-fade-up 0.5s 0.2s ease both;
}

.auth-redirect__link {
    color: var(--color-primary-dark);
    font-weight: 700;
    text-decoration: none;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    border-bottom: 1.5px solid transparent;
    transition:
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.auth-redirect__link:hover {
    border-bottom-color: var(--color-primary-dark);
}

/* ============================================================
   TERMS NOTE
   ============================================================ */
.auth-terms {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-top: var(--space-md);
    padding: 0 var(--space-sm);
    animation: auth-fade-up 0.5s 0.25s ease both;
}

.auth-terms a {
    color: var(--color-primary-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   TRUST BADGES (bottom)
   ============================================================ */
.auth-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    animation: auth-fade-up 0.5s 0.3s ease both;
}

.auth-trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.auth-trust-item__icon {
    font-size: 18px;
    color: var(--color-primary-medium);
}

.auth-trust-item__text {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.3;
}

/* ============================================================
   SUCCESS OVERLAY
   ============================================================ */
.auth-success {
    position: fixed;
    inset: 0;
    background: rgba(253, 248, 249, 0.95);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(8px);
    text-align: center;
    padding: var(--space-xl);
}

.auth-success.show {
    opacity: 1;
    pointer-events: auto;
}

.auth-success__icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: linear-gradient(
        135deg,
        var(--color-primary-dark),
        var(--color-primary)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    box-shadow: var(--shadow-lg);
    animation: success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes success-pop {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.auth-success__title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text-dark);
}

.auth-success__sub {
    font-size: 14px;
    color: var(--color-text-muted);
    max-width: 260px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%) translateY(24px);
    max-width: calc(var(--max-width) - 48px);
    width: calc(100% - 48px);
    background: var(--color-text-dark);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   DESKTOP CENTERING
   ============================================================ */
@media (min-width: 540px) {
    .auth-scroll {
        padding: var(--space-2xl) var(--space-lg);
    }
}

/* ============================================================
   CUSTOM ALERT
   ============================================================ */

.auth-alert-error {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #fff0f3;
    border: 1px solid #ffc2cf;
    color: #c0264a;
    margin-bottom: 20px;
    font-size: 0.92rem;
}

.auth-alert-error ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.auth-alert-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    margin-bottom: 18px;
}

.auth-input.is-invalid {
    border: 1px solid #ef476f;
    background: #fff5f7;
}

.auth-input.is-invalid:focus {
    border-color: #ef476f;
    box-shadow: 0 0 0 4px rgba(239, 71, 111, 0.12);
}

.auth-field-error {
    display: block;
    margin-top: 8px;
    color: #e11d48;
    font-size: 0.82rem;
}
