/* ===== NameMySignature - Signature Theme ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-card: #333333;
    --bg-card-hover: #3a3a3a;
    --text-primary: #f5f5f5;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --accent: #e0e0e0;
    --accent-light: #eeeeee;
    --accent-glow: rgba(224, 224, 224, 0.2);
    --gradient-1: linear-gradient(135deg, #e0e0e0, #9e9e9e);
    --gradient-2: linear-gradient(135deg, #eeeeee, #e0e0e0);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.bg-decoration { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-circle { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.08; }
.bg-circle-1 { width: 600px; height: 600px; background: #e0e0e0; top: -200px; right: -200px; animation: float 20s ease-in-out infinite; }
.bg-circle-2 { width: 400px; height: 400px; background: #9e9e9e; bottom: -100px; left: -100px; animation: float 25s ease-in-out infinite reverse; }
.bg-circle-3 { width: 300px; height: 300px; background: #eeeeee; top: 50%; left: 50%; transform: translate(-50%,-50%); animation: float 15s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(30px,-30px) scale(1.05); } 66% { transform: translate(-20px,20px) scale(0.95); } }

.app { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; padding: 0 24px; min-height: 100vh; display: flex; flex-direction: column; }
.header { text-align: center; padding: 40px 0 28px; }
.logo { font-size: 2.5rem; font-weight: 700; letter-spacing: -1px; background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.2; }
.logo-accent { background: var(--gradient-2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ai-badge-header { display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--gradient-1); color: #333; }

.input-section { margin-bottom: 24px; }
.form-card { background: var(--bg-secondary); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-xl); padding: 32px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.form-input, .form-select {
    width: 100%; padding: 14px 18px; background: var(--bg-card); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md); color: var(--text-primary); font-size: 1rem; font-family: inherit;
    transition: var(--transition); outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-select { cursor: pointer; }

.generate-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 16px 28px; background: var(--gradient-1); color: #333; border: none; border-radius: var(--radius-md); font-size: 1.05rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: var(--transition); }
.generate-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--accent-glow); }

.api-status { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px; }
.api-status.hidden { display: none; }
.api-status.warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: #fbbf24; }

.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 0; color: var(--text-secondary); }
.loading.hidden { display: none; }
.loading-text { font-size: 1rem; font-weight: 500; color: var(--text-primary); }
.loading-sub { font-size: 0.85rem; color: var(--text-muted); opacity: 0.7; }
.pen-loader { position: relative; width: 120px; height: 80px; display: flex; align-items: center; justify-content: center; }
.pen { color: var(--accent); opacity: 0.5; animation: pen-write 1.5s ease-in-out infinite; }
@keyframes pen-write {
    0%,100% { transform: rotate(-30deg) translateX(-20px); opacity: 0.3; }
    50% { transform: rotate(0deg) translateX(20px); opacity: 1; }
}

.error-message { display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius-md); color: #f87171; font-size: 0.9rem; margin-bottom: 16px; }
.error-message.hidden { display: none; }

.results { animation: fadeInUp 0.5s ease-out; }
.results.hidden { display: none; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.results-header { text-align: center; margin-bottom: 24px; }
.results-title { font-size: 1.1rem; font-weight: 500; color: var(--text-secondary); }
.entity-name { color: var(--text-primary); font-weight: 600; }
.entity-description { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; font-style: italic; opacity: 0.7; }

.signature-preview {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 40px;
    margin: 24px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.signature-svg-container { width: 100%; display: flex; justify-content: center; }
.signature-svg-container img { max-width: 100%; height: auto; display: block; border-radius: 4px; }

.signature-actions { margin-bottom: 16px; }

.signature-description {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.footer { margin-top: auto; text-align: center; padding: 32px 0; color: var(--text-secondary); font-size: 0.8rem; opacity: 0.5; }

@media (max-width: 600px) {
    .header { padding: 28px 0 20px; }
    .logo { font-size: 2rem; }
    .signature-preview { padding: 20px; min-height: 180px; }
}