* {
    box-sizing: border-box;
}
html, body {
    padding: 0;
    margin: 0;
    min-height: 100vh;
}
body {
    direction: rtl;
    background-color: #222927;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
}

:root {
    --primary: #C5A059;
    --primary-hover: #d1b16e;
    --bg-card: rgba(69, 84, 81, 0.75);
    --bg-input: rgba(34, 41, 39, 0.85);
    --border: rgba(94, 125, 117, 0.35);
    --border-focus: #C5A059;
    --text-sec: #cbd5e1;
    --text-muted: #94a3b8;
}

.stage {
    width: 100%;
    max-width: 390px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-header {
    text-align: center;
    margin-bottom: 16px;
}

.brand-logo {
    width: 70px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.3));
    display: block;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 18px;
    width: 100%;
    padding: 24px 20px 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.1);
    box-sizing: border-box;
}

.auth-card h2 {
    font-weight: 400;
    font-size: 1.3rem;
    text-align: center;
    margin: 0 0 20px 0;
    color: #f8fafc;
}

.input-group {
    margin-bottom: 14px;
    width: 100%;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sec);
    text-align: right;
    cursor: default;
}

.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"] {
    display: block;
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all .2s;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.3);
    text-align: right;
    box-sizing: border-box;
}

.input-group input:focus {
    border-color: var(--border-focus);
    background: rgba(34,41,39,.95);
    box-shadow: 0 0 0 2px rgba(197,160,89,.25), inset 0 1px 3px rgba(0,0,0,.3);
}

.input-group input::placeholder {
    color: rgba(203,213,225,.4);
}

.error {
    display: block;
    background: rgba(239,68,68,.22);
    border: 1px solid rgba(239,68,68,.5);
    color: #fca5a5;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.5;
    text-align: right;
    margin: 0 0 14px 0;
}

.submit {
    margin: 8px 0 0 0;
}

.button {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #C5A059 0%, #a68443 100%);
    color: #1a201e;
    border: none;
    border-radius: 8px;
    padding: 11px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 12px rgba(197,160,89,.2);
    text-align: center;
    text-decoration: none;
}

.button:hover {
    background: linear-gradient(135deg, #d1b16e 0%, #b8944d 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(197,160,89,.3);
    color: #1a201e;
}

.button-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.button-outline:hover {
    background: var(--primary);
    color: #1a201e;
}

.button-outline img {
    max-width: 22px;
    height: auto;
}

.center {
    text-align: center;
}

.small {
    font-size: 0.85em;
}

.center.small a {
    color: var(--primary);
    text-decoration: none;
}

.center.small a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.home-links {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 20px;
}

.home-links a {
    color: var(--text-sec);
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.2s ease;
}

.home-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.login input[type="text"] {
    text-align: right;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    text-align: right;
}

.checkbox-row input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-row label {
    color: var(--text-sec);
    font-size: 0.9em;
    cursor: pointer;
    margin: 0;
}

.lists {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.privacy-option {
    margin-bottom: 16px;
    text-align: right;
}

.privacy-option label {
    color: #f8fafc;
    font-size: 0.95em;
    cursor: pointer;
}

.privacy-option input[type="radio"] {
    accent-color: var(--primary);
    margin-left: 8px;
}

.privacy-help {
    color: var(--text-muted);
    font-size: 0.85em;
    margin: 4px 0 0 24px;
    line-height: 1.5;
}

.lists-block {
    margin: 18px 0;
    text-align: right;
}

.lists-title {
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-sec);
    margin: 0 0 10px 0;
}

.lists .description {
    color: var(--text-muted);
    font-size: 0.8em;
    line-height: 1.5;
    margin: 2px 0 10px 24px;
}

.captcha {
    margin: 16px 0;
    display: flex;
    justify-content: center;
}

.form .nonce,
input.nonce {
    display: none;
}

.archive {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.archive li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.archive li:last-child {
    border-bottom: none;
}

.archive li a {
    color: #f8fafc;
    text-decoration: none;
    font-size: 0.95em;
    display: block;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

.archive li a:hover {
    color: var(--primary);
}

.archive .date {
    display: block;
    color: var(--text-muted);
    font-size: 0.8em;
}

.archive-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.archive-footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85em;
    display: flex;
    align-items: center;
}

.archive-footer-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.archive-footer-links .feed {
    filter: invert(70%) sepia(40%) saturate(400%) hue-rotate(0deg);
    opacity: 0.8;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pg-page {
    display: inline-block;
    padding: 0 10px;
    text-decoration: none;
    color: var(--text-sec);
}

.pg-page.pg-selected {
    color: var(--primary);
    font-weight: bold;
    text-decoration: underline;
}

.twofa-help {
    color: var(--text-sec);
    font-size: 0.9em;
    line-height: 1.6;
    text-align: center;
    margin: 0 0 20px 0;
}

.totp-input {
    text-align: center !important;
    font-size: 1.6em !important;
    letter-spacing: 6px;
    font-weight: 600;
}

.totp-input::placeholder {
    letter-spacing: 6px;
}

.optin-info {
    color: var(--text-sec);
    font-size: 0.9em;
    line-height: 1.8;
    text-align: center;
    margin: 0 0 20px 0;
}

.optin-lists {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: right;
}

.optin-lists li {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    color: #f8fafc;
    font-size: 0.9em;
}

.message-body {
    color: var(--text-sec);
    font-size: 0.95em;
    line-height: 1.9;
    text-align: center;
}

.message-body a {
    color: var(--primary);
}

.message-body a:hover {
    color: var(--primary-hover);
}

footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.75rem;
    color: #7a7a7a;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

footer a {
    color: #9aa0a0;
    text-decoration: none;
    transition: color .2s ease;
}

footer a:hover {
    color: var(--primary);
}

.powered-by {
    font-size: 0.7rem;
    color: #5a5a5a;
}

.powered-by a {
    color: #6a6a6a;
    font-weight: 500;
}

.powered-by a:hover {
    color: var(--primary);
}