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

html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0f1115;
    color: #e6e6e6;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #8ab4ff;
    text-decoration: none;
}

a:hover {
    color: #b8cdff;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.main {
    flex: 1;
    padding: 32px 0;
}

.site-header,
.site-footer {
    background: #14171d;
    border-color: #232830;
    padding: 16px 0;
}

.site-header {
    border-bottom-style: solid;
    border-bottom-width: 1px;
}

.site-footer {
    border-top-style: solid;
    border-top-width: 1px;
    color: #8b8f97;
    font-size: 13px;
}

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

.logo {
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    font-size: 18px;
}

.nav {
    display: flex;
    gap: 14px;
    align-items: center;
}

.nav a {
    color: #cfd3da;
}

.user-info {
    color: #b6bcc7;
    font-size: 14px;
}

.section {
    background: #161a21;
    padding: 28px;
    border-radius: 8px;
    border: 1px solid #232830;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section h1 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 16px;
}

.section h2 {
    font-size: 18px;
    color: #fff;
    margin: 14px 0 8px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.card {
    background: #1a1f27;
    border: 1px solid #232830;
    border-radius: 8px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    color: #fff;
    font-size: 18px;
    margin-bottom: 4px;
}

.card-sub {
    color: #b6bcc7;
    margin-bottom: 10px;
}

.meta {
    color: #8b8f97;
    font-size: 13px;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.empty {
    text-align: center;
    padding: 40px 0;
    color: #b6bcc7;
}

.empty p {
    margin-bottom: 14px;
}

.btn {
    display: inline-block;
    padding: 9px 16px;
    background: #232830;
    color: #e6e6e6;
    border: 1px solid #2e3440;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
    background: #2a303a;
    border-color: #3a414e;
    color: #fff;
}

.btn-primary {
    background: #3a6df0;
    border-color: #3a6df0;
    color: #fff;
}

.btn-primary:hover {
    background: #4a7af5;
    border-color: #4a7af5;
    color: #fff;
}

.btn-ghost {
    background: transparent;
}

.btn-danger {
    background: #b13a3a;
    border-color: #b13a3a;
    color: #fff;
}

.btn-danger:hover {
    background: #c24a4a;
    border-color: #c24a4a;
}

.btn-full {
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    color: #cfd3da;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea,
.form-textarea,
.form-input {
    background: #0f1115;
    color: #e6e6e6;
    border: 1px solid #2e3440;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s;
}

textarea,
.form-textarea {
    resize: vertical;
    min-height: 80px;
}

input:focus,
select:focus,
textarea:focus,
.form-textarea:focus,
.form-input:focus {
    outline: none;
    border-color: #3a6df0;
}

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

.errors {
    color: #ff8888;
    font-size: 13px;
}

.char-counter {
    float: right;
    font-size: 12px;
    color: #8b8f97;
    font-weight: normal;
}

.char-counter.warning {
    color: #ffcf66;
}

.char-counter.danger {
    color: #ff8888;
}

.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
}

.alert-success {
    background: #1a3a2a;
    border: 1px solid #2a5a3a;
    color: #7ecfa0;
}

.alert-error {
    background: #3a1a1a;
    border: 1px solid #5a2a2a;
    color: #ff8888;
}

.alert-info {
    background: #1a2a3a;
    border: 1px solid #2a3a5a;
    color: #8ab4ff;
}

.alert-warning {
    background: #3a3a1a;
    border: 1px solid #5a5a2a;
    color: #ffcf66;
}

.auth-section {
    display: flex;
    justify-content: center;
    padding-top: 40px;
    background: transparent;
    border: none;
}

.auth-card {
    background: #161a21;
    border: 1px solid #232830;
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: #8b8f97;
    margin-bottom: 24px;
    font-size: 14px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #8b8f97;
    font-size: 14px;
}

.auth-link a {
    color: #8ab4ff;
}

.preview-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #161a21;
    border: 1px solid #232830;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-bar span {
    color: #b6bcc7;
    font-size: 14px;
}

.preview-bar > div {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.resume {
    background: #161a21;
    border: 1px solid #232830;
    border-radius: 8px;
    padding: 34px;
    color: #e6e6e6;
}

.resume .r-section h2,
.resume .r-section-min h2,
.resume .r-side-block h3,
.resume-custom-block-title,
.preview-block-title {
    color: #fff;
    border-bottom: 1px solid #2e3440;
    padding-bottom: 6px;
    margin-bottom: 10px;
    font-size: 17px;
}

.resume .r-section,
.resume .r-section-min,
.resume-modern .r-side-block,
.resume-modern .r-main > .r-section {
    margin-top: 18px;
}

.r-text-content,
.resume-custom-block-content,
.resume .r-section p,
.resume .r-section-min p,
.resume .r-side-block p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
}

.r-text-content p,
.resume-custom-block-content p {
    margin: 0 0 4px 0;
}

.r-text-content p:last-child,
.resume-custom-block-content p:last-child {
    margin-bottom: 0;
}

.r-text-content br,
.resume-custom-block-content br {
    display: none;
}

.resume-classic .r-head {
    display: flex;
    gap: 24px;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid #2e3440;
}

.resume-classic .r-photo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #2e3440;
}

.resume-classic .r-name {
    font-size: 26px;
    color: #fff;
}

.resume-classic .r-position {
    color: #b6bcc7;
    margin-top: 4px;
}

.resume-classic .r-contacts {
    display: flex;
    gap: 18px;
    margin-top: 10px;
    list-style: none;
    color: #cfd3da;
    font-size: 14px;
    flex-wrap: wrap;
}

.resume-modern {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.resume-modern .r-side {
    background: #1a1f27;
    padding: 28px 22px;
    border-right: 1px solid #2e3440;
}

.resume-modern .r-photo-large {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #2e3440;
    margin-bottom: 16px;
}

.resume-modern .r-name {
    color: #fff;
    font-size: 22px;
}

.resume-modern .r-position {
    color: #b6bcc7;
    margin-bottom: 18px;
}

.resume-modern .r-side-block {
    margin-top: 18px;
}

.resume-modern .r-side-block ul {
    list-style: none;
    color: #cfd3da;
    font-size: 14px;
}

.resume-modern .r-side-block li {
    padding: 4px 0;
    border-bottom: 1px solid #232830;
}

.resume-modern .r-main {
    padding: 28px;
}

.resume-minimal {
    max-width: 800px;
    margin: 0 auto;
}

.resume-minimal .r-head-min {
    display: flex;
    gap: 18px;
    align-items: center;
    padding-bottom: 12px;
}

.resume-minimal .r-photo-small {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #2e3440;
}

.resume-minimal .r-name {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.resume-minimal .r-position {
    color: #b6bcc7;
}

.resume-minimal .r-contacts-min {
    display: flex;
    gap: 16px;
    color: #cfd3da;
    font-size: 14px;
    padding: 8px 0 14px;
    border-bottom: 1px solid #2e3440;
    flex-wrap: wrap;
}

.resume-minimal .r-section-min {
    margin-top: 16px;
}

.resume-minimal .r-section-min h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #b6bcc7;
    border: none;
    padding: 0;
    margin-bottom: 8px;
}

.resume-custom {
    background: #161a21;
    border: 1px solid #232830;
    border-radius: 8px;
    overflow: hidden;
}

.resume-custom-header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #232830;
}

.resume-custom-name {
    font-size: 28px;
    color: #fff;
    margin-bottom: 8px;
}

.resume-custom-position {
    color: #b6bcc7;
    font-size: 16px;
}

.resume-custom-photo-top {
    margin-bottom: 20px;
}

.resume-custom-photo-top img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #2e3440;
}

.resume-custom-body {
    display: grid;
}

.resume-custom-two-columns {
    grid-template-columns: 1fr 1fr;
}

.resume-custom-single-column {
    grid-template-columns: 1fr;
}

.resume-custom-left,
.resume-custom-right,
.resume-custom-full {
    padding: 24px;
}

.resume-custom-left {
    border-right: 1px solid #232830;
}

.resume-custom-block {
    margin-bottom: 24px;
}

.resume-custom-block:last-child {
    margin-bottom: 0;
}

.resume-custom-block-title {
    font-size: 16px;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.resume-custom-block-content {
    color: #cfd3da;
    font-size: 14px;
}

.resume-custom-photo img {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #2e3440;
}

.resume-custom-contacts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resume-custom-contacts li {
    padding: 2px 0;
    margin: 0;
}

.resume-custom-block-content > p {
    margin: 0 0 2px 0;
    padding: 0;
}

.resume-custom-block-content > p:last-child {
    margin-bottom: 0;
}

.contact-label {
    color: #8b8f97;
    font-size: 12px;
}

.r-citizenship {
    color: #cfd3da;
    font-size: 14px;
    margin-top: 10px;
}

.customize-section {
    margin-bottom: 30px;
}

.customize-header {
    margin-bottom: 24px;
}

.customize-header h1 {
    margin-bottom: 8px;
}

.customize-header p {
    color: #8b8f97;
    font-size: 14px;
}

.customize-photo-settings,
.customize-column,
.block-item {
    background: #1a1f27;
    border: 1px solid #232830;
    border-radius: 8px;
}

.customize-photo-settings {
    padding: 16px;
    margin-bottom: 16px;
}

.customize-photo-settings h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
}

.layout-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.customize-columns-wrapper {
    margin-bottom: 24px;
}

.customize-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.customize-column {
    padding: 16px;
}

.customize-column h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2e3440;
}

.blocks-list {
    min-height: 100px;
}

.block-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.block-item-handle {
    color: #8b8f97;
    cursor: grab;
    font-size: 18px;
    user-select: none;
}

.block-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.block-title-input {
    background: #161a21;
    color: #e6e6e6;
    border: 1px solid #2e3440;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    width: 100%;
}

.block-title-input:focus {
    outline: none;
    border-color: #3a6df0;
}

.block-visible-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #8b8f97;
    cursor: pointer;
}

.block-item-actions {
    display: flex;
    gap: 4px;
}

.customize-actions {
    display: flex;
    gap: 10px;
}

.preview-section {
    margin-top: 30px;
}

.preview-section h2 {
    margin-bottom: 16px;
}

.resume-preview {
    background: #161a21;
    border: 1px solid #232830;
    border-radius: 8px;
    padding: 24px;
    min-height: 200px;
}

.preview-placeholder,
.preview-error {
    text-align: center;
    padding: 40px;
}

.preview-placeholder {
    color: #8b8f97;
}

.preview-error {
    color: #ff8888;
}

.preview-resume {
    background: #1a1f27;
    border: 1px solid #2e3440;
    border-radius: 8px;
    overflow: hidden;
}

.preview-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #2e3440;
    background: #161a21;
}

.preview-name {
    font-size: 22px;
    color: #fff;
    margin-bottom: 4px;
}

.preview-position {
    color: #b6bcc7;
    font-size: 14px;
}

.preview-photo-top {
    width: 80px;
    height: 80px;
    background: #2a303a;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b8f97;
    font-size: 12px;
}

.preview-photo-side {
    width: 100px;
    height: 100px;
    background: #2a303a;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b8f97;
    font-size: 12px;
}

.preview-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.preview-body.single-column {
    grid-template-columns: 1fr;
}

.preview-left,
.preview-right {
    padding: 20px;
}

.preview-left {
    border-right: 1px solid #2e3440;
}

.preview-block {
    margin-bottom: 20px;
}

.preview-block:last-child {
    margin-bottom: 0;
}

.preview-block-title {
    font-size: 14px;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.preview-block-content {
    color: #cfd3da;
    font-size: 13px;
}

.preview-contacts {
    list-style: none;
    padding: 0;
}

.preview-contacts li {
    padding: 4px 0;
    border-bottom: 1px solid #232830;
    color: #cfd3da;
}

.preview-text {
    color: #8b8f97;
    font-style: italic;
}

@media (max-width: 720px) {
    .resume-modern {
        grid-template-columns: 1fr;
    }

    .resume-modern .r-side {
        border-right: none;
        border-bottom: 1px solid #2e3440;
    }

    .header-inner {
        flex-direction: column;
        gap: 10px;
    }

    .resume-classic .r-head {
        flex-direction: column;
        text-align: center;
    }

    .resume-custom-body {
        grid-template-columns: 1fr;
    }

    .resume-custom-left {
        border-right: none;
        border-bottom: 1px solid #232830;
    }

    .customize-columns {
        grid-template-columns: 1fr;
    }

    .preview-body {
        grid-template-columns: 1fr;
    }

    .preview-left {
        border-right: none;
        border-bottom: 1px solid #2e3440;
    }

    .layout-buttons {
        flex-direction: column;
    }

    .layout-buttons .btn {
        width: 100%;
        text-align: center;
    }
}
