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

:root {
    --primary-green: #2d8659;
    --primary-green-dark: #1f5d3f;
    --primary-green-light: #3fa372;
    --secondary-green: #4caf50;
    --bg-light: #f5f7fa;
    --text-dark: #2c3e50;
    --text-gray: #6c757d;
    --white: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.container-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    text-align: center;
}

.logo-container {
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.logo {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-green-dark);
    margin-bottom: 60px;
    animation: fadeInUp 0.8s ease;
}

.button-container {
    animation: fadeInUp 1s ease;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 25px 60px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    background: var(--primary-green);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    min-width: 250px;
    justify-content: center;
    touch-action: manipulation;
}

.btn-primary:hover {
    background: var(--primary-green-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary i {
    font-size: 1.8rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-green);
    background: var(--white);
    border: 2px solid var(--primary-green);
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.btn-secondary:hover {
    background: var(--primary-green);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-green);
    background: var(--white);
    border: 2px solid var(--primary-green);
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    touch-action: manipulation;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

.btn-back:hover {
    background: var(--primary-green);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-green-dark);
}

.btn-back:active {
    transform: translateY(0);
}

.btn-back i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-back:hover i {
    transform: translateX(-3px);
}

.header-page {
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-green-dark);
    flex: 1;
}

.search-container {
    width: 100%;
    margin-bottom: 25px;
    display: flex;
    justify-content: flex-start;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.12);
}

.search-box i {
    color: var(--primary-green);
    font-size: 1rem;
}

.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    background: transparent;
}

.clear-search {
    border: none;
    background: var(--primary-green);
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.clear-search i {
    color: var(--white);
    font-size: 0.95rem;
    line-height: 1;
}

.clear-search:hover {
    background: var(--primary-green-dark);
    transform: translateY(-1px);
}

.clear-search:active {
    transform: translateY(0);
}

.surat-categories {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.category-section {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-green-dark);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-green);
}

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

.surat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    cursor: pointer;
    touch-action: manipulation;
    min-height: 180px;
    justify-content: center;
}

.surat-card:hover {
    border-color: var(--primary-green);
    background: var(--white);
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.surat-icon {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.surat-card:hover .surat-icon {
    transform: scale(1.1);
}

.surat-name {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

.form-container {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-group label i {
    color: var(--primary-green);
    margin-right: 8px;
}

.required {
    color: #dc3545;
}

.form-input {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    padding: 18px 40px;
    font-size: 1.1rem;
    min-width: 180px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.surat-preview {
    background: var(--white);
    padding: 50px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.kop-surat {
    display: flex;
    align-items: center;
    border-bottom: 3.5px solid #000;
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.kop-logo {
    width: 100px;
    flex-shrink: 0;
}

.kop-logo img {
    width: 85px;
    height: auto;
}

.kop-text {
    flex: 1;
    text-align: center;
    padding-right: 80px;
    /* offset logo width to keep text centered */
}

.kop-text h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.2;
}

.kop-text h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.kop-text p {
    margin: 0 !important;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Surat Content Styling */
.surat-title {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 25px;
}

.surat-title h2 {
    text-decoration: underline;
    font-size: 1.2rem;
    margin-bottom: 0;
    font-weight: 700;
}

.surat-title p {
    margin-top: 0;
}

.surat-pernyataan p {
    margin-bottom: 15px;
}

.surat-body {
    line-height: 1.6;
}

.nomor-surat {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1rem;
}

.nomor-surat p {
    margin: 5px 0;
}

.nomor-surat p:first-child {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.surat-isi {
    font-size: 1rem;
    text-align: justify;
    line-height: 1.7;
}

.surat-isi p {
    margin: 10px 0;
}

.data-table {
    margin: 15px 0;
    width: 100%;
}

.data-table td {
    padding: 2px 0;
    vertical-align: top;
    line-height: 1.4;
}



@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 1.8rem;
        margin-bottom: 40px;
    }

    .btn-primary {
        padding: 20px 40px;
        font-size: 1.2rem;
        min-width: 200px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 25px 20px;
    }

    .surat-preview {
        padding: 30px 20px;
    }

    .kop-surat {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .kop-text {
        text-align: center;
    }

    .kop-text h2 {
        text-align: center;
    }



    .preview-header {
        flex-direction: column;
    }

    .preview-header button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }
}

/* TTD Layout for Preview */
.ttd-section {
    margin-top: 50px;
    width: 100%;
    overflow: hidden;
    clear: both;
}

.ttd-kiri {
    float: left;
    text-align: center;
    width: 280px;
}

.ttd-kanan {
    float: right;
    text-align: center;
    width: 250px;
}

.ttd-kiri p,
.ttd-kanan p {
    margin: 2px 0;
    line-height: 1.4;
    text-align: center;
}