:root {
    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --text-muted: #8a8a8a;
    --border-light: #dedede;
    --bg-light: #fafafa;
    --bg-white: #ffffff;
    --accent: #2563eb;
    --error: #ef4444;
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.text-danger {
    color: var(--error);
}

.document-container {
    max-width: 850px;
    margin: 0 auto;
    padding: 40px 20px;
}

.document {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.document-header {
    text-align: center;
    padding: 15px 40px 15px;
    border-bottom: 1px solid var(--border-light);
}

.document-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.document-header .subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

.institution-info {
    margin-top: 24px;
    padding: 20px 24px;
    background: var(--bg-light);
    border-radius: 8px;
    display: inline-block;
}

.institution-info .name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.institution-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.7;
}

.document-body {
    padding: 40px;
}

.section {
    margin-bottom: 36px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-content {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.75;
}

.section-content p {
    margin-bottom: 12px;
}

.section-content p:last-child {
    margin-bottom: 0;
}

.form-fields {
    display: grid;
    gap: 16px;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.field-row.single {
    grid-template-columns: 1fr;
}

.field-row.triple {
    grid-template-columns: repeat(3, 1fr);
}

.form-field {
    position: relative;
}

.form-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--text-muted);
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.fee-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.fee-table th,
.fee-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.fee-table th {
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 11px;
    background: var(--bg-light);
}

.fee-table td {
    color: var(--text-secondary);
}

.fee-table .amount-cell {
    width: 180px;
}

.fee-table .amount-cell input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    text-align: right;
}

.fee-table .amount-cell input:focus {
    outline: none;
    border-color: var(--accent);
}

.fee-table tr.total td {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-light);
}

.policy-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.policy-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.policy-list li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-light);
}

.policy-list li:last-child {
    margin-bottom: 0;
}

.refund-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
}

.refund-table th,
.refund-table td {
    padding: 14px 20px;
    text-align: left;
    font-size: 13px;
}

.refund-table th {
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 11px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.refund-table td {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.refund-table tr:last-child td {
    border-bottom: none;
}

.subsection {
    margin-top: 20px;
    padding-left: 16px;
    border-left: 2px solid var(--border-light);
}

.subsection-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.notice-box {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
}

.notice-box .notice-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.notice-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notice-box li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.notice-box li:before {
    content: "•";
    position: absolute;
    left: 4px;
    color: var(--text-muted);
}

.signature-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
}

/* .signature-block {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 32px;
            margin-top: 24px;
        } */

.signature-box {
    padding: 24px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-white);
}

.signature-box-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 20px;
}

.signature-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.signature-line {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
    min-height: 36px;
}

.signature-line.signature-area {
    min-height: 80px;
    position: relative;
}

.signature-line label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.signature-canvas-wrapper {
    position: relative;
    border: 1px dashed var(--border-light);
    border-radius: 8px;
    background: var(--bg-light);
    min-height: 100px;
    margin-bottom: 8px;
}

.signature-canvas {
    width: 100%;
    height: 100px;
    cursor: crosshair;
    display: block;
}

.clear-signature {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.clear-signature:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.date-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
}

.date-input:focus {
    outline: none;
    border-color: var(--accent);
}

.document-footer {
    padding: 24px 40px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.footer-note {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-group {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.btn-primary {
    background: #d18c15;
    color: var(--bg-white);
}

.btn-primary:hover {
    background: #068e37;
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-white);
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    padding: 48px 40px;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: #ecfdf5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.modal-icon svg {
    width: 32px;
    height: 32px;
    color: #10b981;
}

.modal h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal .btn {
    width: 100%;
}

.logo img {
    width: 150px;
}

/* Intl Tel Input */
.iti {
    width: 100%;
}

.iti__flag-container {
    padding: 0;
}

.iti__selected-flag {
    padding: 0 8px 0 14px;
    border-radius: 8px 0 0 8px;
}

.iti--separate-dial-code .iti__selected-flag {
    background-color: var(--border-light);
}

.form-label .required {
    color: var(--error);
    margin-left: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .document-container {
        padding: 16px;
    }

    .document-header {
        padding: 32px 24px;
    }

    .document-body {
        padding: 24px;
    }

    .field-row,
    .field-row.triple {
        grid-template-columns: 1fr;
    }

    .signature-block {
        grid-template-columns: 1fr;
    }

    .document-footer {
        flex-direction: column;
        gap: 16px;
        padding: 20px 24px;
    }

    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
    }
}
