/* ===================================================================
   Password Analyser — Premium Dark Theme
   =================================================================== */

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

:root {
    --bg:        #0b0e17;
    --surface:   rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --border:    rgba(255, 255, 255, 0.08);
    --text:      #e4e6ef;
    --text-dim:  #8a8ea3;
    --accent:    #6c63ff;
    --accent-2:  #00d4aa;
    --danger:    #ff4d6a;
    --warning:   #ffb347;
    --success:   #00d4aa;
    --gradient:  linear-gradient(135deg, #6c63ff 0%, #00d4aa 100%);
    --radius:    16px;
    --radius-sm: 10px;
    --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ── Animated Background Orbs ─────────────────────────────────────── */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
}
.bg-orb--1 {
    width: 500px; height: 500px;
    background: #6c63ff;
    top: -120px; left: -100px;
    animation: float1 18s ease-in-out infinite;
}
.bg-orb--2 {
    width: 400px; height: 400px;
    background: #00d4aa;
    bottom: -80px; right: -60px;
    animation: float2 22s ease-in-out infinite;
}
.bg-orb--3 {
    width: 300px; height: 300px;
    background: #ff4d6a;
    top: 50%; left: 55%;
    animation: float3 20s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.1); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -30px) scale(1.15); }
}
@keyframes float3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -50px) scale(0.9); }
}

/* ── Container ────────────────────────────────────────────────────── */
.container {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 20px 32px;
}

/* ── Header ───────────────────────────────────────────────────────── */
.header {
    text-align: center;
    margin-bottom: 36px;
}
.header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    border-radius: 16px;
    background: var(--gradient);
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(108, 99, 255, 0.35);
}
.header__icon svg {
    width: 28px; height: 28px;
    color: #fff;
}
.header__title {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}
.header__subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-top: 6px;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    margin-bottom: 20px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}
.card__title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    margin-bottom: 18px;
}

/* ── Input Section ────────────────────────────────────────────────── */
.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95rem;
}
.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}
.password-input {
    width: 100%;
    padding: 16px 52px 16px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.password-input::placeholder {
    color: var(--text-dim);
}
.password-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}
.toggle-btn {
    position: absolute;
    top: 50%; right: 14px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    transition: color 0.2s;
    padding: 4px;
}
.toggle-btn:hover { color: var(--text); }
.toggle-btn svg { width: 20px; height: 20px; }

/* Analyse button */
.analyse-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--gradient);
    color: #fff;
    font-family: var(--font);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.15s;
}
.analyse-btn:hover { opacity: 0.92; transform: scale(1.01); }
.analyse-btn:active { transform: scale(0.98); }
.analyse-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Loader spinner inside button */
.analyse-btn__loader {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.privacy-note {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.78rem;
    margin-top: 14px;
}

/* ── Error Toast ──────────────────────────────────────────────────── */
.error-toast {
    background: rgba(255, 77, 106, 0.12);
    border: 1px solid rgba(255, 77, 106, 0.3);
    color: var(--danger);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 20px;
    animation: fadeSlide 0.3s ease;
}

/* ── Score Ring ────────────────────────────────────────────────────── */
.card--strength { text-align: center; }
.score-ring-wrapper {
    position: relative;
    display: inline-block;
    width: 140px; height: 140px;
}
.score-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring__bg {
    fill: none;
    stroke: var(--surface-2);
    stroke-width: 8;
}
.score-ring__fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1s ease, stroke 0.4s ease;
}
.score-ring__value {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.score-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}
.score-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    color: var(--text-dim);
}

/* ── Criteria List ────────────────────────────────────────────────── */
.criteria-list {
    list-style: none;
}
.criteria-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--border);
    animation: fadeSlide 0.35s ease both;
}
.criteria-list li:last-child { border-bottom: none; }
.criteria-list li:nth-child(1) { animation-delay: 0.05s; }
.criteria-list li:nth-child(2) { animation-delay: 0.1s; }
.criteria-list li:nth-child(3) { animation-delay: 0.15s; }
.criteria-list li:nth-child(4) { animation-delay: 0.2s; }
.criteria-list li:nth-child(5) { animation-delay: 0.25s; }
.criteria-list li:nth-child(6) { animation-delay: 0.3s; }
.criteria-list li:nth-child(7) { animation-delay: 0.35s; }
.criteria-list li:nth-child(8) { animation-delay: 0.4s; }
.criteria-list li:nth-child(9) { animation-delay: 0.45s; }

.criteria-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}
.criteria-icon--pass {
    background: rgba(0, 212, 170, 0.15);
    color: var(--success);
}
.criteria-icon--fail {
    background: rgba(255, 77, 106, 0.15);
    color: var(--danger);
}

/* ── Stats ────────────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.stat {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 18px 16px;
    text-align: center;
}
.stat__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.stat__value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Breach Card ──────────────────────────────────────────────────── */
.breach-status {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.5;
}
.breach-sub {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: 6px;
}
.card--breach.safe   { border-color: rgba(0, 212, 170, 0.3); }
.card--breach.danger  { border-color: rgba(255, 77, 106, 0.35); background: rgba(255, 77, 106, 0.05); }

/* ── Suggestions ──────────────────────────────────────────────────── */
.suggestions-list {
    list-style: none;
}
.suggestions-list li {
    position: relative;
    padding: 7px 0 7px 22px;
    font-size: 0.9rem;
    color: var(--text-dim);
    animation: fadeSlide 0.35s ease both;
}
.suggestions-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 24px 20px 40px;
    font-size: 0.78rem;
    color: var(--text-dim);
}
.footer a {
    color: var(--accent);
    text-decoration: none;
}
.footer a:hover {
    text-decoration: underline;
}

/* ── Utilities ────────────────────────────────────────────────────── */
.hidden { display: none !important; }

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

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .container { padding: 32px 14px 24px; }
    .card { padding: 22px 18px; }
    .header__title { font-size: 1.6rem; }
    .stat-grid { grid-template-columns: 1fr; }
}
