/* ========================================
   criscuolo.online — Design System
   Guia: criscuolo_design_guidelines.md
   ======================================== */
:root {
    /* Brand Colors */
    --brand-black: #1A1A1A;
    --brand-gold: #D4A843;
    --brand-gold-light: #E0BE6A;
    --brand-gold-dark: #B8922F;
    --brand-gradient: linear-gradient(135deg, #D4A843, #E0BE6A, #D4A843);
    --cta-gradient: linear-gradient(135deg, #D4A843, #B8922F);

    /* Backgrounds */
    --bg-primary: #16161E;
    --bg-secondary: #1C1C26;
    --bg-card: rgba(24, 24, 32, 0.88);
    --bg-card-border: rgba(212, 168, 67, 0.14);
    --bg-input: #141420;
    --bg-hover: rgba(212, 168, 67, 0.08);

    /* Text */
    --text-primary: #F2F0EB;
    --text-secondary: #9B978E;
    --text-muted: #6B6760;
    --text-accent: #D4A843;

    /* Strength Colors */
    --strength-weak: #ef4444;
    --strength-fair: #f97316;
    --strength-good: #eab308;
    --strength-strong: #22c55e;
    --strength-very-strong: #10b981;

    /* Misc */
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-xs: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glow: 0 0 40px rgba(212, 168, 67, 0.1);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ========================================
   Background Effects
   ======================================== */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.2), transparent 70%);
    top: -15%;
    left: -10%;
    animation-duration: 25s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(184, 146, 47, 0.15), transparent 70%);
    top: 50%;
    right: -10%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08), transparent 70%);
    bottom: -10%;
    left: 30%;
    animation-duration: 22s;
    animation-delay: -10s;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(212, 168, 67, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 168, 67, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 10px) scale(1.02); }
}

/* ========================================
   Main Layout
   ======================================== */
main {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ========================================
   Header / Logo
   ======================================== */
.header {
    width: 100%;
    padding: 8px 0 20px;
    display: flex;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.logo-img-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 60%, rgba(255, 255, 255, 0.6) 80%, transparent 100%);
    border-radius: 50%;
    padding: 6px;
    transition: var(--transition);
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.15);
}

.logo-img-wrapper:hover {
    box-shadow: 0 0 30px rgba(212, 168, 67, 0.25);
    transform: scale(1.05);
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.logo-text-group {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text-accent {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--brand-gold);
    letter-spacing: -0.02em;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    text-align: center;
    padding: 28px 0 36px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

.gradient-text {
    display: block;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   Generator Card
   ======================================== */
.generator-card {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    animation: cardEntry 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEntry {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   Password Display
   ======================================== */
.password-display {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 20px;
}

.password-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid rgba(212, 168, 67, 0.18);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    transition: var(--transition);
    overflow: hidden;
}

.password-field:hover {
    border-color: rgba(212, 168, 67, 0.35);
}

.password-text {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: all;
    cursor: text;
}

.password-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.strength-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    transition: var(--transition);
}

.strength-badge.weak {
    background: rgba(239, 68, 68, 0.15);
    color: var(--strength-weak);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.strength-badge.fair {
    background: rgba(249, 115, 22, 0.15);
    color: var(--strength-fair);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.strength-badge.good {
    background: rgba(234, 179, 8, 0.15);
    color: var(--strength-good);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.strength-badge.strong {
    background: rgba(34, 197, 94, 0.15);
    color: var(--strength-strong);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.strength-badge.very-strong {
    background: rgba(16, 185, 129, 0.15);
    color: var(--strength-very-strong);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Buttons */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--brand-gold-light);
    background: var(--bg-hover);
}

.btn-refresh:active svg {
    animation: spin 0.5s ease;
}

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

.btn-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--cta-gradient);
    border: none;
    border-radius: var(--border-radius-sm);
    color: #0C0C0E;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(212, 168, 67, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-copy svg {
    stroke: #0C0C0E;
}

.btn-copy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 168, 67, 0.35);
}

.btn-copy:hover::before {
    opacity: 1;
}

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

.btn-copy.copied {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    color: white;
}

.btn-copy.copied svg {
    stroke: white;
}

/* ========================================
   Strength Meter
   ======================================== */
.strength-meter {
    margin-bottom: 28px;
}

.strength-bars {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.strength-bar {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: rgba(107, 103, 96, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.strength-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.strength-bar.active::after {
    left: 0;
}

.strength-bar.weak::after { background: var(--strength-weak); }
.strength-bar.fair::after { background: var(--strength-fair); }
.strength-bar.good::after { background: var(--strength-good); }
.strength-bar.strong::after { background: var(--strength-strong); }
.strength-bar.very-strong::after { background: var(--strength-very-strong); }

.strength-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.strength-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.strength-label.weak { color: var(--strength-weak); }
.strength-label.fair { color: var(--strength-fair); }
.strength-label.good { color: var(--strength-good); }
.strength-label.strong { color: var(--strength-strong); }
.strength-label.very-strong { color: var(--strength-very-strong); }

.strength-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ========================================
   Separator
   ======================================== */
.separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.2), transparent);
    margin-bottom: 28px;
}

/* ========================================
   Controls
   ======================================== */
.control-group {
    margin-bottom: 24px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.control-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: block;
}

.control-header .control-label {
    margin-bottom: 0;
}

.length-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-gold);
    min-width: 42px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ========================================
   Slider
   ======================================== */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-adjust {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(212, 168, 67, 0.18);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-adjust:hover {
    border-color: var(--brand-gold);
    color: var(--brand-gold-light);
    background: var(--bg-hover);
}

.btn-adjust:active {
    transform: scale(0.93);
}

.slider-wrapper {
    flex: 1;
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(107, 103, 96, 0.15);
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.slider-track {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
    background: var(--brand-gradient);
    pointer-events: none;
    z-index: 1;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(212, 168, 67, 0.2);
}

/* Slider Thumb */
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-gold);
    cursor: pointer;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--brand-gold), 0 2px 8px rgba(212, 168, 67, 0.4);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    z-index: 3;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px var(--brand-gold-light), 0 4px 15px rgba(212, 168, 67, 0.5);
}

.slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-gold);
    cursor: pointer;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--brand-gold), 0 2px 8px rgba(212, 168, 67, 0.4);
    transition: box-shadow 0.2s, transform 0.2s;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px var(--brand-gold-light), 0 4px 15px rgba(212, 168, 67, 0.5);
}

.slider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(107, 103, 96, 0.15);
    border: none;
}

/* ========================================
   Character Options
   ======================================== */
.char-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.char-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-input);
    border: 1px solid rgba(212, 168, 67, 0.1);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.char-option:hover {
    border-color: rgba(212, 168, 67, 0.3);
    background: var(--bg-hover);
}

.char-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-visual {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid rgba(107, 103, 96, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: transparent;
}

.check-icon {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #0C0C0E;
}

.char-option input:checked ~ .checkbox-visual {
    background: var(--brand-gradient);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(212, 168, 67, 0.3);
}

.char-option input:checked ~ .checkbox-visual .check-icon {
    opacity: 1;
    transform: scale(1);
}

.char-option input:checked ~ .char-label {
    color: var(--text-primary);
}

.char-label {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-muted);
    transition: var(--transition);
    font-family: var(--font-mono);
}

.char-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Disabled state for last active checkbox */
.char-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   Info Section
   ======================================== */
.info-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    margin-top: 40px;
}

.info-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-sm);
    padding: 24px 20px;
    text-align: center;
    transition: var(--transition);
}

.info-card:hover {
    border-color: rgba(212, 168, 67, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(212, 168, 67, 0.1);
    color: var(--brand-gold-light);
    margin-bottom: 14px;
}

.info-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.info-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    margin-top: 48px;
    text-align: center;
    padding: 20px;
}

.footer p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--brand-gold);
}

.footer-accent {
    color: var(--brand-gold);
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(16, 185, 129, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    color: white;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.3);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    pointer-events: none;
}

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

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 640px) {
    main {
        padding: 16px 14px 32px;
    }

    .generator-card {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .password-display {
        flex-direction: column;
        gap: 10px;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    .char-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .slider-container {
        gap: 8px;
    }

    .btn-adjust {
        width: 36px;
        height: 36px;
    }

    .logo-img {
        height: 44px;
    }

    .logo-text,
    .logo-text-accent {
        font-size: 1.15rem;
    }
}

@media (max-width: 420px) {
    .char-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .char-option {
        padding: 12px 8px;
    }

    .length-value {
        font-size: 1.4rem;
    }
}

/* ========================================
   Animations for page load
   ======================================== */
.header {
    animation: fadeDown 0.5s ease both;
}

.hero {
    animation: fadeDown 0.5s ease 0.1s both;
}

.info-section {
    animation: fadeUp 0.6s ease 0.3s both;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 67, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 168, 67, 0.4);
}

/* ========================================
   Selection
   ======================================== */
::selection {
    background: rgba(212, 168, 67, 0.25);
    color: var(--text-primary);
}

/* ========================================
   Ad Containers (Google AdSense)
   ======================================== */
.ad-container {
    width: 100%;
    max-width: 720px;
    margin: 24px auto;
    background: var(--bg-secondary);
    border: 1px dashed var(--bg-card-border);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.ad-container::before {
    content: 'Anúncio';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.5;
}

.ad-container:hover {
    border-color: rgba(212, 168, 67, 0.3);
    background: var(--bg-hover);
}

.ad-top {
    margin-top: 0;
    margin-bottom: 32px;
}

.ad-mid {
    margin: 40px 0;
}

.ad-bottom {
    margin-top: 40px;
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .ad-container {
        min-height: 100px;
        margin: 20px 0;
    }
}
