/* ═══════════════════════════════════════
   Ỉn Ỉn — Base / Shared Styles
   ═══════════════════════════════════════ */

/* ============================================
   Ỉn Ỉn — Personal Translator & Journal
   Theme: Matcha & Blush — soft green, warm cream, gentle contrast
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Nunito:wght@400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
    --bg-base:        #f4f7f2;
    --bg-card:        #f9fbf7;
    --bg-header:      #eef3eb;
    --bg-input:       #ffffff;
    --border:         #cddec6;
    --text-primary:   #1e2b1a;
    --text-secondary: #4a6644;
    --text-muted:     #8aaa82;
    --accent-matcha:  #6a9e5e;
    --accent-deep:    #4a7a3e;
    --accent-light:   #a8c9a0;
    --accent-soft:    #e8f2e4;
    --accent-blush:   #f2c4be;
    --accent-rose:    #d4837a;
    --shadow-sm:      0 1px 4px rgba(80, 120, 70, 0.08);
    --shadow-md:      0 4px 16px rgba(80, 120, 70, 0.12);
    --shadow-lg:      0 8px 32px rgba(80, 120, 70, 0.14);
    --radius:         0.75rem;
    --transition:     all 0.22s ease;
}

.dark {
    --bg-base:        #131a11;
    --bg-card:        #192016;
    --bg-header:      #161d13;
    --bg-input:       #1e2a1a;
    --border:         #2e422a;
    --text-primary:   #edf4ea;
    --text-secondary: #b8d4af;
    --text-muted:     #6e9467;
    --accent-soft:    #1e3020;
    --accent-blush:   #3d2420;
    --accent-matcha:  #7dba6f;
    --accent-deep:    #5e9e52;
    --accent-light:   #9ed096;
    --shadow-sm:      0 1px 4px rgba(0,0,0,0.3);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg:      0 8px 32px rgba(0,0,0,0.5);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

.page-body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse at 10% 0%, rgba(106, 158, 94, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 100%, rgba(242, 196, 190, 0.1) 0%, transparent 55%);
    min-height: 100vh;
}

/* ── Layout ── */
.page-wrapper {
    width: 100%;
    max-width: 90rem;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 640px) {
    .page-wrapper { padding: 1.5rem; }
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Header ── */
.app-header {
    width: 100%;
    background-color: var(--bg-header);
    border-bottom: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1.5rem;
    box-sizing: border-box;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 2rem;
}

/* ── Translator 4-column grid ── */
.translator-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .translator-columns { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .translator-columns { grid-template-columns: 1fr; }
}

.header-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    max-width: 90rem;
    margin: 0 auto;
    gap: 1rem;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .header-container { gap: 0.5rem; }
    .header-title { font-size: 1.5rem; }
    .header-piglet, .header-piglet svg { width: 32px; height: 32px; }
    /* Hide desktop nav pills, show hamburger */
    .header-center { display: none; }
    .nav-hamburger { display: flex !important; }
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: center;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: flex-end;
}

/* Nav pills */
.header-nav {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 9999px;
    padding: 0.2rem;
    gap: 0.1rem;
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.nav-pill:hover {
    color: var(--accent-deep);
    background: var(--accent-soft);
}

.nav-pill-active {
    background: linear-gradient(135deg, var(--accent-deep), var(--accent-matcha));
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(106,158,94,0.3);
}

.nav-pill-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.header-piglet {
    display: flex;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(244,167,185,0.5));
    animation: piglet-bounce 3s ease-in-out infinite;
}
.header-piglet svg {
    width: 44px;
    height: 44px;
}

/* Floating piglet fixed at bottom right */
.floating-piglet {
    will-change: transform;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 10px rgba(106,158,94,0.3));
    animation: piglet-bounce 2.5s ease-in-out infinite;
    transition: transform 0.3s ease;
    z-index: 100;
    cursor: pointer;
}

.floating-piglet:hover {
    animation: none;
    transform: scale(1.15) rotate(-8deg);
}


.header-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent-matcha) 60%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1;
}


/* ── Theme Toggle ── */
.theme-toggle-button {
    padding: 0.4rem;
    border-radius: 9999px;
    color: var(--text-muted);
    background: none;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle-button:hover {
    background-color: var(--accent-soft);
    border-color: var(--accent-matcha);
    color: var(--accent-matcha);
    transform: rotate(20deg);
}

/* ── Header Auth Buttons (login/register pages) ── */
.header-btn {
    padding: 0.35rem 0.9rem;
    border-radius: 9999px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.header-btn-outline {
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    background: transparent;
}

.header-btn-outline:hover {
    border-color: var(--accent-matcha);
    color: var(--accent-matcha);
    background: var(--accent-soft);
}

.header-btn-solid {
    background: linear-gradient(135deg, var(--accent-deep), var(--accent-matcha));
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(106,158,94,0.3);
}

.header-btn-solid:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(106,158,94,0.4);
}

/* ── Translator Card ── */
.translator-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .translator-card { padding: 2rem; }
}

/* ── Columns ── */
.column { display: flex; flex-direction: column; }

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border);
}

.column:nth-child(1) .column-header { border-bottom-color: #6a9e5e; }
.column:nth-child(2) .column-header { border-bottom-color: #8ab89e; }
.column:nth-child(3) .column-header { border-bottom-color: #f2c4be; }
.column:nth-child(4) .column-header { border-bottom-color: #4a7a3e; }

.column-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

/* ── Copy Button ── */
.copy-button {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 0.3rem;
    transition: var(--transition);
}

.copy-button:hover {
    color: var(--accent-matcha);
    background-color: var(--accent-soft);
    transform: scale(1.1);
}

/* ── Textareas ── */
.textarea-wrapper { position: relative; flex-grow: 1; }

.translator-box {
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    padding: 1rem;
    background-color: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
    resize: vertical;
    box-sizing: border-box;
}

.translator-box::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.column:nth-child(1) .translator-box:focus {
    border-color: #6a9e5e;
    box-shadow: 0 0 0 3px rgba(106,158,94,0.15);
    outline: none;
}
.column:nth-child(2) .translator-box:focus {
    border-color: #8ab89e;
    box-shadow: 0 0 0 3px rgba(138,184,158,0.15);
    outline: none;
}
.column:nth-child(3) .translator-box:focus {
    border-color: #f2c4be;
    box-shadow: 0 0 0 3px rgba(242,196,190,0.2);
    outline: none;
}
.column:nth-child(4) .translator-box:focus {
    border-color: #4a7a3e;
    box-shadow: 0 0 0 3px rgba(74,122,62,0.15);
    outline: none;
}

/* ── Clear Button ── */
.clear-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.clear-button:hover {
    background-color: var(--accent-matcha);
    border-color: var(--accent-matcha);
    color: #fff;
    transform: scale(1.1);
}

/* ── Spinner ── */
.button-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    min-height: 2.5rem;
}

.spinner {
    width: 1.8rem;
    height: 1.8rem;
    border: 3px solid var(--border);
    border-top-color: var(--accent-matcha);
    border-radius: 9999px;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.icon { width: 1.25rem; height: 1.25rem; }

/* ── Auth Pages ── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background-color: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.auth-piglet {
    width: 72px;
    height: 72px;
    margin: 0 auto 0.5rem;
    display: block;
    filter: drop-shadow(0 3px 6px rgba(106,158,94,0.25));
    animation: piglet-bounce 2.5s ease-in-out infinite;
}

@keyframes piglet-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: 0.2rem;
    margin-bottom: 1.5rem;
}

.auth-alert {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.88rem;
    text-align: left;
}

.auth-alert-error {
    background-color: rgba(212,131,122,0.08);
    border: 1px solid rgba(212,131,122,0.3);
    color: var(--accent-rose);
}

.auth-alert-success {
    background-color: rgba(106,158,94,0.08);
    border: 1px solid rgba(106,158,94,0.3);
    color: var(--accent-matcha);
}

.auth-field {
    margin-bottom: 1.2rem;
    text-align: left;
}

.auth-label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.auth-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background-color: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-matcha);
    box-shadow: 0 0 0 3px rgba(106,158,94,0.15);
}

.auth-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    margin-bottom: 0;
}

.auth-button {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--accent-deep), var(--accent-matcha));
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    box-shadow: 0 3px 10px rgba(106,158,94,0.3);
}

.auth-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(106,158,94,0.4);
}

.auth-switch {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 0;
}

.auth-link {
    color: var(--accent-matcha);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover { text-decoration: underline; }

/* ── Password Rules ── */
.password-rules {
    list-style: none;
    padding: 0.6rem 0.75rem;
    margin: 0.5rem 0 0;
    background-color: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.rule       { color: var(--text-muted); transition: color 0.2s; }
.rule-pass  { color: var(--accent-matcha); }
.rule-fail  { color: var(--accent-rose); }
/* ════════════════════════════════════════
   NEW AUTH PAGE STYLES
   ════════════════════════════════════════ */

.auth-page-body {
    overflow-x: hidden;
}

.auth-scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

/* Decorative background blobs */
.auth-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}
.auth-blob-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(106,158,94,0.12) 0%, transparent 70%);
    top: -100px; left: -100px;
}
.auth-blob-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(242,196,190,0.1) 0%, transparent 70%);
    bottom: -80px; right: -80px;
}

.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2.25rem 2rem;
    text-align: center;
}

/* Piglet centered above card title */
.auth-card-piglet-wrap {
    margin: 0 auto 0.5rem;
    width: 80px;
    height: 80px;
}
.auth-card-piglet {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(244,167,185,0.5));
    animation: piglet-bounce 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.auth-card-piglet:hover { animation: none; transform: scale(1.12) rotate(-6deg); }

.auth-card-brand {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-deep), var(--accent-matcha));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.2rem;
    line-height: 1;
}

/* Input with icon */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-input-icon {
    position: absolute;
    left: 0.75rem;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}
.auth-input-icon-pad {
    padding-left: 2.4rem !important;
}
.auth-eye-btn {
    position: absolute;
    right: 0.6rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem;
    color: var(--text-muted);
    line-height: 1;
    border-radius: 0.25rem;
    transition: var(--transition);
}
.auth-eye-btn:hover { color: var(--accent-matcha); }

/* Auth form */
.auth-form { text-align: left; margin-top: 1.25rem; }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Muted link variant */
.auth-link-muted {
    color: var(--text-muted) !important;
    font-weight: 400 !important;
    font-size: 0.82rem;
}
.auth-link-muted:hover { color: var(--accent-matcha) !important; }

/* Password strength bar */
.auth-strength-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.auth-strength-bar {
    flex: 1;
    height: 5px;
    background: var(--bg-input);
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.auth-strength-fill {
    height: 100%;
    border-radius: 9999px;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}
.auth-strength-label {
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 56px;
    transition: color 0.3s;
}
