:root {
    --system-font: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --bg-color: #f5f5f7;
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(255, 255, 255, 0.5);
    --primary-color: #0071e3;
    --primary-hover: #0077ed;
    --text-main: #1d1d1f;
    --text-secondary: #86868b;
    --input-bg: rgba(118, 118, 128, 0.06);
    --input-focus-bg: #ffffff;
    --divider: rgba(0, 0, 0, 0.08);
    
    --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.04);
    --radius-card: 22px;
    --radius-input: 12px;
    --radius-btn: 12px;

    --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
}

html {
    height: 100%;
}

body {
    font-family: var(--system-font);
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, #eef2f5 0%, #e6e9ef 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 24px 20px;
    overflow-y: auto;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.body.container {
    width: 100% !important;
    max-width: 640px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: block !important;
}

.row.typecho-page-main {
    margin: 0 !important;
    width: auto !important;
    display: block !important;
    float: none !important;
}

.col-mb-12, .col-tb-8, .col-tb-offset-2 {
    width: 100% !important;
    max-width: 640px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: none !important;
    float: none !important;
}

.hidden, .typecho-page-main.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
h1 {
    text-align: center;
    margin-block: 0 20px;
    margin-inline: 0 0;
}

h1 img {
    height: 50px;
    width: auto;
    display: inline-block;
    transition: transform 0.3s var(--ease-out);
}

h1 a:hover img {
    transform: scale(1.02);
}

.i-logo-s {
    display: inline-block;
    height: 24px;
    width: auto;
    line-height: 1;
}

.i-logo-s img {
    height: 24px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.typecho-page-main {
    background: var(--card-bg);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 40px !important;
    position: relative;
    overflow: hidden;
}

.typecho-page-title {
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
}

.typecho-page-title h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0 0 30px;
    text-align: center;
    color: var(--text-main);
    width: 100%;
}

h3 {
    font-size: 19px;
    font-weight: 600;
    margin: 40px 0 16px;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

p, li {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

#typecho-welcome {
    margin-top: 0;
    background: #ebebeb;
    border-radius: var(--radius-card);
    padding: 30px;
}

form {
    margin-top: 10px;
}

ul.typecho-option {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.typecho-option li {
    margin-bottom: 28px;
}

label.typecho-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
    margin-inline-start: 4px;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 0 16px;
    height: 54px;
    font-size: 17px;
    line-height: 54px;
    font-family: inherit;
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-input);
    color: var(--text-main);
    transition: all 0.2s var(--ease-out);
    margin: 0;
}

textarea {
    height: auto;
    padding: 16px;
    line-height: 1.3;
}

input:focus, textarea:focus, select:focus {
    background-color: var(--input-focus-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
    outline: none;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-inline-end: 40px;
    cursor: pointer;
    background-color: var(--input-bg);
    color: var(--text-main) !important;
    opacity: 1;
}

.description {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 8px;
    margin-inline-start: 4px;
    line-height: 1.4;
}

button.btn.primary {
    display: block;
    width: 100%;
    padding: 16px 24px;
    min-height: 52px;
    height: auto;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    color: #fff;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 113, 227, 0.2);
}

button.btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.3);
}

button.btn.primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.2);
}

button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--text-secondary);
    box-shadow: none;
    transform: none;
}

.warning {
    background: #fff8eb;
    border: 1px solid rgba(255, 149, 0, 0.15);
    border-radius: var(--radius-btn);
    padding: 20px;
    color: #8a4b00;
    font-size: 14px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.warning strong {
    color: #5c3200;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

#typecho-welcome ul {
    padding-inline-start: 0;
    margin-bottom: 30px;
}

#typecho-welcome ul li {
    list-style: none;
    padding-inline-start: 24px;
    margin-bottom: 12px;
    position: relative;
    color: var(--text-secondary);
}

#typecho-welcome ul li::before {
    content: "";
    position: absolute;
    inset-inline-start: 8px;
    top: 9px;
    width: 6px;
    height: 6px;
    background-color: #d1d1d6;
    border-radius: 50%;
}

details {
    margin-top: 20px;
    margin-bottom: 30px;
    border-top: 1px solid var(--divider);
    padding-top: 20px;
}

details summary {
    margin-bottom: 0;
    color: var(--text-main);
    font-size: 15px;
    list-style: none;
    outline: none;
    cursor: pointer;
}

details[open] summary {
    margin-bottom: 24px;
}

details ul.typecho-option:last-child li:last-child {
    margin-bottom: 0;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary strong {
    font-weight: 600;
    display: flex;
    align-items: center;
}

details summary strong::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-inline-start: 8px;
    border-inline-end: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s var(--ease-out);
}

details[open] summary strong::after {
    transform: rotate(225deg) translateY(-2px);
}

p.submit {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--divider);
    display: flex;
    flex-direction: column-reverse;
    gap: 16px;
}

.typecho-option-submit {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none;
}

.typecho-option-submit li {
    margin-bottom: 0 !important;
}
p.submit select {
    width: 100%;
    margin: 0 !important;
    float: none !important;
}

@media (min-width: 600px) {
    p.submit {
        flex-direction: row;
        align-items: center;
    }

    p.submit button {
        width: auto;
        flex: 1;
        margin-inline-end: 0;
    }

    p.submit select {
        width: auto;
        min-width: 140px;
        margin-inline-start: 16px;
    }
}

form > .message {
    display: none;
    background: rgba(255, 59, 48, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 59, 48, 0.2);
    color: #d70015;
    padding: 24px;
    border-radius: var(--radius-btn);
    margin-bottom: 30px;
    font-size: 15px;
    font-weight: 500;
}

.message.fade {
    display: block;
    animation: fadeIn 0.3s var(--ease-out);
}

form > .message > p:first-child:not(:last-child) {
    display: block;
    margin-bottom: 24px;
    color: #d70015;
    text-align: center;
    font-size: 16px;
    width: 100%;
    font-weight: 600;
}

.message p {
    margin-block: 20px 0;
    margin-inline: 0 0;
    display: flex;
    flex-direction: row;
    gap: 16px;
    justify-content: center;
    width: 100%;
}

.message p button {
    flex: 1;
    margin-inline-start: 0;
    padding: 10px 16px;
    background: #d70015;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    box-shadow: 0 2px 6px rgba(215, 0, 21, 0.2);
    white-space: nowrap;
}

.message p button:hover {
    background: #ff3b30;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(215, 0, 21, 0.3);
}

.message p button:active {
    transform: scale(0.98);
}

#success {
    text-align: center;
}

#success h2 {
    color: #34c759;
    margin-bottom: 40px;
    font-size: 36px;
}

.fresh-word {
    margin: 30px 0;
    line-height: 2;
    font-size: 16px;
}

.fresh-word strong {
    color: var(--text-main);
    font-weight: 600;
    background: rgba(0,0,0,0.05);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

#success ul {
    margin: 50px 0;
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

#success ul li {
    padding: 0;
    list-style: none;
}

#success ul li::before {
    display: none;
}

#success ul li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 16px 28px;
    background: rgba(0, 113, 227, 0.08);
    border-radius: var(--radius-btn);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s var(--ease-out);
}

#success ul li a:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.2);
    text-decoration: none;
}

#success p:last-child {
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

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

@media (max-width: 599px) {
    body {
        padding: 0;
        background: #fff;
    }

    h1 {
        margin: 30px 0;
    }

    .typecho-page-main {
        border-radius: 0;
        box-shadow: none;
        border: none;
        padding: 20px 24px 40px !important;
        background: transparent;
        backdrop-filter: none;
    }
    
    #success {
        padding: 20px 24px 40px !important;
    }

    .typecho-page-title h2 {
        font-size: 28px;
    }
}

/*

==========================================================================
  Persian (fa-IR) localization — appended RTL & font layer (installer)
  بسته فارسی‌ساز TypeRenew — لایه راست‌چین و فونت (صفحه نصب)
  ------------------------------------------------------------------
  - Activates only when the installer language is Persian: <html lang="fa-IR">
  - Font: Vazirmatn (v33.003, SIL OFL 1.1) bundled at admin/css/fonts/
==========================================================================

*/

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- RTL direction (Persian only) ---------- */

html:lang(fa) {
    direction: rtl;
}

/* ---------- Vazirmatn font + Persian digits ---------- */

html:lang(fa) body,
html:lang(fa) input,
html:lang(fa) select,
html:lang(fa) textarea,
html:lang(fa) button {
    font-family: 'Vazirmatn', var(--system-font);
    font-feature-settings: "ss01", "ss02", "ss03";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* monospace fragments stay LTR */

html:lang(fa) pre,
html:lang(fa) code,
html:lang(fa) kbd,
html:lang(fa) samp,
html:lang(fa) .mono {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}

/* URL / e-mail inputs keep LTR content */

html:lang(fa) input[type="url"],
html:lang(fa) input[type="email"] {
    direction: ltr;
    text-align: right;
    unicode-bidi: plaintext;
}
