/* ===================================================
   Fog+Frog Email Signature Generator
   Light tool UI · Inter · ff-logo
   =================================================== */

:root {
    --font-body: 'Inter', sans-serif;

    --bg: #f0f1f3;
    --surface: #fff;
    --text: #1a2a2e;
    --text-secondary: #555d65;
    --text-muted: #8c939a;
    --accent: #0077a0;
    --accent-hover: #006080;
    --accent-light: rgba(0, 119, 160, 0.08);
    --border: #dcdfe3;
    --border-light: #e8eaed;
    --success: #58a860;
    --error: #d85050;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ========== LOGIN PAGE ========== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2.5rem 2.25rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-card .logo {
    margin-bottom: 2rem;
}

.login-card .logo img {
    width: 120px;
    display: block;
    margin: 0 auto;
}

.login-card h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.login-card .tagline {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 400;
    margin-bottom: 2rem;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.65rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}

.google-btn:hover {
    border-color: #bbb;
    box-shadow: var(--shadow);
}

.google-btn:active {
    background: #f8f8f8;
}

.google-btn svg {
    flex-shrink: 0;
}

.footer-note {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* ========== NAV ========== */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
}

.nav-brand img {
    height: 22px;
}

.nav-brand span {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-user img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.version-badge {
    position: fixed;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.65rem;
    color: #bbb;
}

.nav-user a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.15s;
}

.nav-user a:hover {
    color: var(--text);
}


/* ========== GENERATE PAGE ========== */

.generate-page {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 2rem;
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 50px);
    align-items: start;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-card h1 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.form-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.form-group input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238c939a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2rem;
}

.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    flex: 1;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: #bbb;
    background: #fafafa;
}

.btn-success-flash {
    background: var(--success) !important;
    color: #fff !important;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

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


/* ========== EMAIL MOCK PREVIEW ========== */

.preview-section {
    position: sticky;
    top: 2rem;
}

.email-mock {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.email-mock-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: #f6f6f7;
    border-bottom: 1px solid var(--border-light);
}

.email-mock-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #EF6B5E; }
.dot-yellow { background: #F5BE4F; }
.dot-green { background: #61C554; }

.email-mock-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: auto;
    margin-right: auto;
    padding-right: 42px;
}

.email-mock-meta {
    padding: 0.75rem 1.15rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.meta-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.12rem 0;
}

.meta-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    min-width: 48px;
}

.meta-row strong {
    color: var(--text);
    font-weight: 500;
}

.email-mock-body {
    padding: 1.15rem;
}

.email-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.email-text p {
    margin-bottom: 0.3rem;
}

.email-mock-divider {
    width: 32px;
    height: 1px;
    background: var(--border);
    margin-bottom: 0.85rem;
}


/* ========== ANIMATIONS ========== */

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

.animate-in > * {
    animation: fadeUp 0.4s ease-out both;
}

.animate-in > *:nth-child(1) { animation-delay: 0.03s; }
.animate-in > *:nth-child(2) { animation-delay: 0.06s; }
.animate-in > *:nth-child(3) { animation-delay: 0.09s; }
.animate-in > *:nth-child(4) { animation-delay: 0.12s; }
.animate-in > *:nth-child(5) { animation-delay: 0.15s; }
.animate-in > *:nth-child(6) { animation-delay: 0.18s; }


/* ========== TOAST ========== */

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.55rem 1rem;
    background: var(--text);
    color: #fff;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.2s ease, toastOut 0.2s ease 2.5s forwards;
    z-index: 1000;
}

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

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


/* ========== PHOTO UPLOAD ========== */

.photo-upload {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.photo-thumbnail-wrap {
    position: relative;
    flex-shrink: 0;
}

.photo-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--bg);
}

.photo-reset {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s, border-color 0.15s;
}

.photo-reset:hover {
    color: var(--error);
    border-color: var(--error);
}

.photo-drop {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.photo-drop:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.photo-drop.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.photo-drop.uploading {
    pointer-events: none;
    opacity: 0.6;
}

.photo-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.photo-drop svg {
    flex-shrink: 0;
}


/* ========== RESPONSIVE ========== */

@media (max-width: 48em) {
    .generate-page {
        grid-template-columns: 1fr;
        padding: 1.25rem 1rem;
    }

    .preview-section {
        position: static;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .nav {
        padding: 0.6rem 1rem;
    }
}
