/* ==========================================================================
   Sözleşme ve Onay Sayfası Tasarım Sistemi (Aesthetic & Glassmorphism)
   ========================================================================== */

:root {
    --primary-color: #20409a;
    /* Kurumsal Lacivert */
    --primary-hover: #172e70;
    --primary-light: rgba(32, 64, 154, 0.08);
    --success-color: #10b981;
    /* Canlı Yeşil */
    --success-light: #ecfdf5;
    --warning-color: #f59e0b;
    /* Canlı Turuncu */
    --warning-light: #fffbeb;
    --danger-color: #ef4444;
    --text-main: #1f2937;
    /* Koyu Gri */
    --text-muted: #6b7280;
    /* Açık Koyu Gri */
    --bg-gradient: linear-gradient(135deg, #f3f6fc 0%, #e8eef9 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --border-color: #e5e7eb;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.06), 0 2px 10px -2px rgba(0, 0, 0, 0.02);
    --shadow-strong: 0 20px 50px -12px rgba(32, 64, 154, 0.15);
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Base resets & layout */
.sozlesme-body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.sozlesme-container {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Header */
.sozlesme-header {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

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

.sozlesme-logo {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}

.sozlesme-logo-text {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
}

.badge-pending {
    background-color: var(--warning-light);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Main Cards */
.sozlesme-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sozlesme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 45px -10px rgba(0, 0, 0, 0.08);
}

/* Document Details */
.document-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

.document-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    background: #f8fafc;
    padding: 20px 25px;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.meta-value {
    font-size: 15px;
    color: var(--text-main);
    font-weight: 600;
}

.price-tag {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
}

.document-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 30px 0;
}

/* Contract Text Body styling */
.formatted-content {
    font-size: 15px;
    color: #374151;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 15px;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 25px;
    background: #fafafa;
}

/* Custom Scrollbar for contract body */
.formatted-content::-webkit-scrollbar {
    width: 6px;
}

.formatted-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.formatted-content::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 10px;
}

.formatted-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.formatted-content h3,
.formatted-content h4 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 700;
}

.formatted-content h3 {
    font-size: 18px;
}

.formatted-content h4 {
    font-size: 16px;
}

.formatted-content p {
    margin-bottom: 15px;
    text-align: justify;
}

/* Form Styles & Controls */
.sozlesme-form {
    margin-top: 25px;
}

.form-checkbox-wrapper {
    margin-bottom: 25px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    border: 1px dashed var(--primary-color);
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    font-weight: 500;
    line-height: 1.5;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 3px;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input~.checkmark {
    border-color: var(--primary-color);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    display: inline-block;
    color: #4b5563;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-decoration: none !important;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 14px rgba(32, 64, 154, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(32, 64, 154, 0.4);
    color: #fff;
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-2px);
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn-payment {
    background: linear-gradient(135deg, #20409a 0%, #1e3a8a 100%);
    box-shadow: 0 4px 18px rgba(30, 58, 138, 0.35);
}

/* Pulse animation for payment button */
.pulse-animation {
    animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {
    0% {
        box-shadow: 0 0 0 0 rgba(32, 64, 154, 0.6);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(32, 64, 154, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(32, 64, 154, 0);
    }
}

/* Form Message Feedback */
.form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-success {
    background: var(--success-light);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.message-error {
    background: #fef2f2;
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Signed State Card styling */
.success-banner {
    text-align: center;
    background: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.success-icon {
    font-size: 48px;
    color: var(--success-color);
    margin-bottom: 15px;
}

.success-banner h3 {
    margin: 0 0 10px 0;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #065f46;
}

.success-banner p {
    margin: 0;
    color: #047857;
    font-size: 14px;
}

.signature-details h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-main);
}

.signature-log-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.log-item {
    display: flex;
    flex-direction: column;
}

.log-item.full-width {
    grid-column: 1 / -1;
}

.log-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.log-value {
    font-size: 13px;
    font-family: monospace;
    color: #334155;
    word-break: break-all;
}

/* Password Protection Screen styling */
.card-password-protection {
    text-align: center;
    padding: 50px 40px;
    box-shadow: var(--shadow-strong);
}

.password-lock-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 25px;
}

.card-password-protection h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.card-password-protection p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 30px auto;
}

.sozlesme-password-form {
    max-width: 380px;
    margin: 0 auto;
}

.sozlesme-password-form .form-group {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: border-color 0.2s ease;
}

.sozlesme-password-form .form-group:focus-within {
    border-color: var(--primary-color);
}

.sozlesme-password-form input[type="password"] {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 10px 15px;
    font-size: 15px;
    outline: none;
    color: var(--text-main);
    width: 100%;
}

.sozlesme-password-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s ease;
}

.sozlesme-password-form button:hover {
    background: var(--primary-hover);
}

.security-note {
    margin-top: 35px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    max-width: 420px;
    background: #f8fafc;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}

.security-note i {
    color: var(--primary-color);
    font-size: 20px;
}

.security-note span {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Footer Styling */
.sozlesme-footer {
    text-align: center;
    margin-top: 40px;
    padding-bottom: 20px;
}

.sozlesme-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.sozlesme-footer .footer-subtext {
    margin-top: 5px;
    font-size: 11px;
    opacity: 0.7;
}

/* Utility classes */
.d-none {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .sozlesme-card {
        padding: 25px;
    }

    .document-meta-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .header-inner {
        flex-direction: column;
        text-align: center;
    }

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

    .action-buttons a {
        width: 100%;
    }
}