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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
    color: #1f2937;
    background: #f9fafb;
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.site-header nav a {
    margin-left: 1.25rem;
    color: #374151;
    text-decoration: none;
}

.site-header nav a:hover {
    color: #2563eb;
}

main.container {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    color: #111827;
}

.hero .lead {
    font-size: 1.125rem;
    color: #4b5563;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
}

.btn:hover {
    background: #1d4ed8;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: #111827;
}

.about h1 {
    margin-bottom: 1rem;
}

.about p {
    margin-bottom: 1rem;
    color: #374151;
}

.nav-user {
    margin-left: 1.25rem;
    color: #111827;
    font-weight: 600;
}

.login {
    max-width: 420px;
    margin: 2rem auto;
    text-align: center;
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.login h1 {
    margin-bottom: 0.5rem;
    color: #111827;
}

.login-sub {
    color: #4b5563;
    margin-bottom: 1.75rem;
}

.login .g_id_signin {
    display: inline-block;
}

.login-warning {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
}

.login-warning code {
    background: #fef3c7;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
}

.login-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.auth-tab {
    flex: 1;
    padding: 0.6rem 0;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-tab.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.auth-form input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

.auth-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-block {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
    margin: 1.5rem 0 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e5e7eb;
}

.auth-divider span {
    padding: 0 0.75rem;
}

.hidden {
    display: none !important;
}

/* --- Face score page ---------------------------------------------------- */
.score-hero {
    text-align: center;
    padding: 1.5rem 0 2rem;
}

.score-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.score-hero .lead {
    font-size: 1.05rem;
    color: #4b5563;
}

.uploader {
    max-width: 560px;
    margin: 0 auto;
}

.dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    border: 2px dashed #cbd5e1;
    border-radius: 1rem;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.dragging {
    border-color: #2563eb;
    background: #eff6ff;
}

.dropzone-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    padding: 2rem;
    text-align: center;
}

.dropzone-icon {
    font-size: 2.5rem;
}

.dropzone-text {
    font-weight: 600;
    color: #374151;
}

.dropzone-hint {
    font-size: 0.85rem;
    color: #9ca3af;
}

.preview {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 0.75rem;
}

#score-form .btn-block {
    margin-top: 1rem;
}

.btn-block:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.score-error {
    margin-top: 1rem;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
}

.loading {
    margin-top: 1.5rem;
    text-align: center;
    color: #4b5563;
    font-weight: 600;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #c7d2fe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: -2px;
    margin-right: 0.4rem;
}

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

.result-card {
    margin-top: 1.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.75rem;
}

.result-top {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.tier-badge {
    width: 72px;
    height: 72px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    border-radius: 1rem;
    background: #6b7280;
}

.tier-badge[data-tier="S"] { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.tier-badge[data-tier="A"] { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.tier-badge[data-tier="B"] { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.tier-badge[data-tier="C"] { background: linear-gradient(135deg, #10b981, #22c55e); }
.tier-badge[data-tier="D"] { background: #64748b; }
.tier-badge[data-tier="F"] { background: #94a3b8; }

.score-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.score-max {
    font-size: 1.1rem;
    font-weight: 600;
    color: #9ca3af;
    margin-left: 0.35rem;
}

.score-label {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.result-rank {
    display: inline-block;
    align-self: center;
    margin: 0 auto 1rem;
    padding: 0.45rem 0.9rem;
    border-radius: 16px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.5;
}

.result-comment {
    color: #374151;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.result-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.result-list {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
}

.result-list h4 {
    margin-bottom: 0.5rem;
    color: #111827;
    font-size: 0.95rem;
}

.result-list ul {
    margin: 0;
    padding-left: 1.1rem;
    color: #4b5563;
    font-size: 0.92rem;
}

.result-list li {
    margin-bottom: 0.3rem;
}

.btn-secondary {
    display: inline-block;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.disclaimer {
    margin-top: 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.82rem;
}

.site-footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}
