/**
 * BettyBloom Main Styles - Enhanced
 */

:root {
    --primary-pink: #e91e8c;
    --primary-purple: #9c27b0;
    --primary-gradient: linear-gradient(135deg, #e91e8c, #9c27b0);
    --secondary-pink: #f06292;
    --light-pink: #fce4ec;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-600: #757575;
    --gray-800: #424242;
    --gray-900: #212121;
    --shadow: 0 8px 32px rgba(233, 30, 140, 0.15);
    --shadow-lg: 0 16px 48px rgba(233, 30, 140, 0.2);
    --radius: 16px;
    --radius-lg: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --blur: 20px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 30%, #e8eaf6 60%, #e0f7fa 100%);
    overflow: hidden;
}

/* Animated Background */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
    animation: floatBubble 20s ease-in-out infinite;
}

body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(233, 30, 140, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(156, 39, 176, 0.15) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -10s;
}

/* Floating Orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.4;
    animation: floatOrb 25s ease-in-out infinite;
}

.orb:nth-child(1) {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(233, 30, 140, 0.1) 0%, transparent 70%);
    top: 20%;
    left: 10%;
    animation-delay: -5s;
}

.orb:nth-child(2) {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(156, 39, 176, 0.1) 0%, transparent 70%);
    bottom: 30%;
    right: 15%;
    animation-delay: -15s;
}

.orb:nth-child(3) {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(233, 30, 140, 0.08) 0%, transparent 70%);
    top: 60%;
    left: 50%;
    animation-delay: -8s;
}

/* Animations */
@keyframes floatBubble {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 30px) scale(0.9); }
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(50px, -80px); }
    50% { transform: translate(-30px, 20px); }
    75% { transform: translate(40px, -40px); }
}

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
    padding: 20px 0;
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    transition: box-shadow var(--transition);
    margin: 0 12px;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-header .logo {
    font-size: 48px;
    margin-bottom: 8px;
    display: block;
}

.auth-header h1 {
    font-size: 32px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--gray-600);
    font-size: 16px;
    font-weight: 400;
}

/* Form */
.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 6px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    transition: var(--transition);
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    color: var(--gray-900);
}

.auth-form input:focus {
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 4px rgba(233, 30, 140, 0.1);
    background: var(--white);
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px !important;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    padding: 8px;
    border-radius: 8px;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s ease, filter 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-block {
    width: 100%;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 14px;
    color: var(--gray-600);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-pink);
    cursor: pointer;
}

.forgot-link {
    font-size: 14px;
    color: var(--primary-pink);
    text-decoration: none;
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 14px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-success .success-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 8px;
}

.alert-success h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #16a34a;
}

.alert-success p {
    margin-bottom: 4px;
    color: #15803d;
}

.alert-success .verification-note {
    font-size: 13px;
    color: #65a30d;
    margin: 8px 0 16px;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gray-600);
}

.auth-footer a {
    color: var(--primary-pink);
    text-decoration: none;
    font-weight: 600;
}

.auth-terms {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: var(--gray-600);
}

.auth-terms a {
    color: var(--gray-800);
    text-decoration: none;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 12px;
        background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 50%, #e8eaf6 100%);
    }

    body::before,
    body::after {
        display: none;
    }

    .orb {
        display: none;
    }

    .auth-card {
        padding: 28px 20px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-radius: var(--radius);
    }

    .auth-header h1 {
        font-size: 26px;
    }

    .auth-header .logo {
        font-size: 36px;
    }

    .auth-form input[type="text"],
    .auth-form input[type="email"],
    .auth-form input[type="password"] {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .auth-card {
        padding: 40px 36px;
    }
}

/* Loading State */
.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* Password Strength */
.password-strength {
    margin-top: 6px;
    height: 3px;
    border-radius: 4px;
    background: var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: var(--transition);
}

.password-strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: #22c55e;
}

/* ========================================== */
/* AUTH PAGES - SCROLL FIX                    */
/* ========================================== */

body.auth-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 20px 0 40px;
    overflow-y: auto;
    height: auto;
}

body.auth-page .auth-container {
    padding: 12px 0 30px;
}

body.auth-page .auth-card {
    margin: 0 12px;
}

@media (max-width: 480px) {
    body.auth-page {
        padding: 12px 0 30px;
    }
    body.auth-page .auth-card {
        margin: 0 8px;
        padding: 20px 16px;
    }
}

/* ========================================== */
/* ANIMATED GLOWING BORDER FOR BUTTONS        */
/* ========================================== */

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    0%   { --angle: 0deg; }
    100% { --angle: 360deg; }
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

@keyframes shimmerSweep {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ========================================== */
/* PRIMARY BUTTON WITH ANIMATED BORDER        */
/* ========================================== */

.btn-primary {
    position: relative;
    background: linear-gradient(135deg, #e91e8c, #9c27b0);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
    isolation: isolate;
    transition: box-shadow 0.3s ease, filter 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 15px;
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        #e91e8c 60deg,
        #f06292 90deg,
        #ffffff 120deg,
        #9c27b0 180deg,
        #e91e8c 240deg,
        transparent 300deg,
        transparent 360deg
    );
    z-index: -1;
    animation: rotateBorder 3s linear infinite;
    padding: 3px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #e91e8c, #9c27b0);
    border-radius: 12px;
    z-index: -1;
}

.btn-primary .btn-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 80%
    );
    background-size: 200% 100%;
    animation: shimmerSweep 3s ease-in-out infinite;
    border-radius: 12px;
    pointer-events: none;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* ========================================== */
/* GLOWING BORDER FOR OUTLINED BUTTONS        */
/* ========================================== */

.btn-outline-glow {
    position: relative;
    background: transparent;
    color: #e91e8c;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
    isolation: isolate;
    transition: color 0.3s ease;
}

.btn-outline-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        #e91e8c 60deg,
        #f06292 90deg,
        #ffffff 120deg,
        #9c27b0 180deg,
        #e91e8c 240deg,
        transparent 300deg,
        transparent 360deg
    );
    z-index: -1;
    animation: rotateBorder 3s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 2px;
    pointer-events: none;
}

.btn-outline-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    border-radius: 12px;
    z-index: -1;
    transition: background 0.3s ease;
}

/* ========================================== */
/* PILL BUTTON WITH GLOW                       */
/* ========================================== */

.btn-pill-glow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: white;
    color: #e91e8c;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
    isolation: isolate;
    transition: color 0.3s ease;
}

.btn-pill-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 52px;
    background: conic-gradient(
        from var(--angle),
        #e91e8c 0deg,
        #f06292 90deg,
        #ffffff 180deg,
        #9c27b0 270deg,
        #e91e8c 360deg
    );
    z-index: -1;
    animation: rotateBorder 4s linear infinite;
    pointer-events: none;
}

.btn-pill-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    border-radius: 50px;
    z-index: -1;
    margin: 2px;
    transition: background 0.3s ease;
}

/* ========================================== */
/* HOVER EFFECTS — TRUE DESKTOP ONLY          */
/* ========================================== */
/* These use (hover: hover) AND (pointer: fine) so that WebViews
   and OEM mobile browsers that misreport hover capabilities
   do NOT trigger these on tap. */

@media (hover: hover) and (pointer: fine) {
    .auth-card:hover {
        box-shadow: var(--shadow-lg), 0 0 0 1px rgba(233, 30, 140, 0.05);
    }
    .toggle-password:hover {
        color: var(--primary-pink);
        background: rgba(233, 30, 140, 0.05);
    }
    .btn-primary:hover {
        box-shadow: 0 8px 25px rgba(233, 30, 140, 0.35), 0 0 40px rgba(233, 30, 140, 0.25);
    }
    .btn-primary:hover::before {
        animation-duration: 1.5s;
        filter: brightness(1.3) blur(1px);
    }
    .btn-outline-glow:hover {
        color: white;
    }
    .btn-outline-glow:hover::after {
        background: linear-gradient(135deg, #e91e8c, #9c27b0);
    }
    .btn-pill-glow:hover {
        color: white;
    }
    .btn-pill-glow:hover::after {
        background: linear-gradient(135deg, #e91e8c, #9c27b0);
    }
    .forgot-link:hover {
        text-decoration: underline;
    }
    .auth-footer a:hover {
        text-decoration: underline;
    }
    .auth-terms a:hover {
        text-decoration: underline;
    }
}

/* ========================================== */
/* REDUCED MOTION SUPPORT                      */
/* ========================================== */

@media (prefers-reduced-motion: reduce) {
    .btn-primary::before,
    .btn-outline-glow::before,
    .btn-pill-glow::before {
        animation: none;
        background: linear-gradient(135deg, #e91e8c, #9c27b0);
    }
    .btn-primary .btn-shimmer {
        animation: none;
        display: none;
    }
}