* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4fbfd;
    color: #0f2c3f;
}

.topbar {
    background: linear-gradient(90deg, #0a7da3, #0a5a78);
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-text h1,
.brand-text p {
    margin: 0;
}

.logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
}

.container {
    max-width: 1100px;
    margin: 28px auto;
    padding: 0 16px;
}

.card, .login-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.login-card {
    width: min(420px, 92vw);
}

.error-text {
    color: #c62828;
    background: #fdecec;
    border: 1px solid #f5c2c2;
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 8px;
    margin-bottom: 2px;
}

.input-error {
    border-color: #c62828 !important;
    background: #fff8f8;
}

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: 600;
}

input, textarea, select, button {
    width: 100%;
    padding: 10px;
    border: 1px solid #c8d7e1;
    border-radius: 8px;
    font-size: 14px;
}

button {
    background: #0a7da3;
    border: none;
    color: #fff;
    cursor: pointer;
    margin-top: 16px;
}

button.secondary {
    background: #5b6b76;
}

.logout {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal-content {
    background: #fff;
    max-width: 980px;
    width: 100%;
    max-height: 92vh;
    overflow: auto;
    border-radius: 12px;
    padding: 22px;
}

.blog-preview {
    border: 1px solid #e5edf3;
    border-radius: 8px;
    padding: 14px;
    background: #fcfeff;
    margin-top: 12px;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.actions button {
    width: auto;
    min-width: 130px;
}

.close-modal-btn {
    float: right;
    width: 34px;
    height: 34px;
    margin-top: 0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 24px;
    padding: 0;
    background: #eef4f8;
    color: #1d3b51;
}

.generate-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 23, 34, 0.45);
    display: grid;
    place-items: center;
    z-index: 9999;
}

.overlay-card {
    width: min(460px, 92vw);
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
    text-align: center;
}

.spinner {
    margin: 0 auto 10px auto;
    width: 38px;
    height: 38px;
    border: 4px solid #d7e8ef;
    border-top-color: #0a7da3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-track {
    margin-top: 10px;
    width: 100%;
    height: 10px;
    background: #e4edf2;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #0a7da3, #2db0cb);
    transition: width 0.25s ease;
}

body.loading-state .topbar,
body.loading-state .container {
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
}

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