/**
 * Frontend Form Styles
 *
 * @package BMPT_Admission
 * @since 1.0.0
 */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.bmpt-admission-form-page {
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 0;
}

/* Container */
.bmpt-form-container {
    max-width: 100%;
    margin: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: visible;
}

/* Header */
.bmpt-form-header {
    background: #fff;
    color: #1f2937;
    padding: 50px 80px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: relative;
}

.bmpt-header-content {
    max-width: 900px;
    margin: 0 auto;
}

.bmpt-logo {
    margin-bottom: 24px;
}

.bmpt-logo h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
    color: #111827;
    line-height: 1.2;
}

.bmpt-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 0;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.bmpt-form-title {
    font-family: 'Times New Roman', Times, serif;
    font-size: 16px;
    font-weight: 400;
    color: #374151;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f3f4f6;
    letter-spacing: -0.01em;
    white-space: pre-wrap;
}

/* Progress Indicator */
.bmpt-progress-wrapper {
    background: #fff;
    padding: 36px 80px;
    border-bottom: 1px solid #e5e7eb;
}

.bmpt-progress-container {
    max-width: 900px;
    margin: 0 auto;
}

.bmpt-progress-bar {
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 28px;
    position: relative;
}

.bmpt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.bmpt-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.bmpt-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bmpt-step.active .step-number {
    background: #2563eb;
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.bmpt-step.completed .step-number {
    background: #10b981;
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.step-label {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.3s ease;
}

.bmpt-step.active .step-label {
    color: #2563eb;
    font-weight: 700;
}

.bmpt-step.completed .step-label {
    color: #10b981;
    font-weight: 600;
}

.bmpt-step:not(.active):not(.completed):hover .step-number {
    background: #e5e7eb;
    color: #4b5563;
    transform: translateY(-2px);
}

.bmpt-step:not(.active):not(.completed):hover .step-label {
    color: #6b7280;
}

/* Main Form */
.bmpt-form-main {
    padding: 50px 80px;
    max-width: 1400px;
    margin: 0 auto;
    background: #f8f9fa;
}

.bmpt-form {
    position: relative;
}

/* Form Steps */
.bmpt-form-step {
    display: none;
}

.bmpt-form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
    background: #fff;
    padding: 32px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

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

.step-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.step-description {
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 15px;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

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

label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 15px;
}

.required {
    color: #e53e3e;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.2s ease;
    font-family: inherit;
    background: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input.error,
textarea.error {
    border-color: #e53e3e;
}

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

.error-message {
    display: none;
    color: #e53e3e;
    font-size: 13px;
    margin-top: 6px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 4px;
    cursor: pointer;
}

.checkbox-label.declaration {
    padding: 16px;
    background: #f9fafb;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

/* Academic Table */
.academic-table-wrapper {
    overflow-x: auto;
    margin-bottom: 24px;
}

.academic-table {
    width: 100%;
    border-collapse: collapse;
}

.academic-table th,
.academic-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.academic-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.academic-table input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.academic-table input:focus {
    outline: none;
    border-color: #2563eb;
}

.academic-table input.error {
    border-color: #e53e3e;
    background: #fff5f5;
}

.academic-table td .error-message {
    display: none;
    color: #e53e3e;
    font-size: 11px;
    margin-top: 4px;
    line-height: 1.3;
}

/* File Upload */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.upload-box {
    display: flex;
    flex-direction: column;
}

.upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 200px;
    background: #fafafa;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

.upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-icon {
    font-size: 48px;
}

.upload-text {
    font-size: 14px;
    color: #666;
}

.upload-preview {
    position: relative;
}

.preview-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 6px;
    background-color: #f3f4f6;
}

.btn-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e53e3e;
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #c53030;
    transform: scale(1.1);
}

/* Multiple file upload styles */
.upload-box-multiple .upload-area {
    min-height: auto;
}

.upload-hint {
    font-size: 13px;
    color: #666;
    margin: -8px 0 8px 0;
}

.upload-note {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    font-style: italic;
}

.upload-preview-multiple {
    text-align: left;
}

.preview-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background 0.3s ease;
}

.preview-item:hover {
    background: #e9ecef;
}

.file-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: #666;
}

.btn-remove-item {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e53e3e;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-remove-item:hover {
    background: #c53030;
    transform: scale(1.1);
}

.btn-remove-all {
    width: 100%;
    padding: 10px;
    background: #e53e3e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remove-all:hover {
    background: #c53030;
}

/* Review Section */
.review-section {
    margin-bottom: 30px;
}

.review-category {
    margin-bottom: 30px;
    padding: 0;
    background: #fff;
    border-radius: 0;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #2563eb;
    overflow: hidden;
}

.review-category h4 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0;
    padding: 20px 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-content {
    padding: 24px;
}

.review-content p {
    margin-bottom: 10px;
    color: #374151;
    font-size: 15px;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.review-table th,
.review-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.review-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.review-table td {
    color: #111827;
    font-size: 15px;
}

.review-table tr:last-child td {
    border-bottom: none;
}

.review-documents p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grid layout for document thumbnails */
.review-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.review-document-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.review-thumbnail {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background-color: #f3f4f6;
    overflow: hidden;
    margin-bottom: 8px;
}

.review-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.review-thumbnail.empty {
    background-color: #f9fafb;
    border-style: dashed;
}

.review-thumbnail .empty-icon {
    font-size: 40px;
    opacity: 0.4;
}

.review-document-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.review-document-item.uploaded .review-document-label {
    color: #059669;
}

.review-document-item.not-uploaded .review-document-label {
    color: #dc2626;
}

.status-icon {
    font-weight: bold;
}

.uploaded {
    color: #4caf50;
}

.not-uploaded {
    color: #e53e3e;
}

/* Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
}

.btn {
    padding: 11px 24px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-prev:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-next,
.btn-submit {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-next:hover,
.btn-submit:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-edit {
    padding: 6px 16px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    background: #1d4ed8;
}

.btn-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Message */
.form-message {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Draft Management Styles */
.draft-notification {
    background: #1e40af;
    color: #fff;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

.draft-notification-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 30px;
}

.draft-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.draft-message {
    flex: 1;
}

.draft-message h4 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.draft-message p {
    margin: 4px 0;
    opacity: 0.95;
}

.draft-id {
    font-size: 13px;
    margin-top: 8px !important;
}

.draft-id strong {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.draft-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.draft-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-restore {
    background: #fff;
    color: #2563eb;
}

.btn-restore:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-discard {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-discard:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Draft Save Indicator */
.draft-save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 10000;
    pointer-events: none;
}

.draft-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Draft Message Toast */
.draft-message-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 15px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
}

.draft-message-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.draft-message-toast.success {
    background: #4caf50;
}

.draft-message-toast.info {
    background: #2196f3;
}

.draft-message-toast.error {
    background: #f44336;
}

/* Footer */
.bmpt-form-footer {
    background: #fff;
    padding: 36px 80px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    border-top: 1px solid #e5e7eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    body.bmpt-admission-form-page {
        padding: 0;
    }

    .bmpt-form-container {
        border-radius: 0;
    }

    .bmpt-form-header {
        padding: 30px 24px;
    }

    .bmpt-progress-wrapper {
        padding: 24px;
    }

    .bmpt-form-main {
        padding: 30px 20px;
    }

    .bmpt-form-footer {
        padding: 24px 20px;
    }

    .bmpt-header-content {
        max-width: 100%;
    }

    .bmpt-logo {
        margin-bottom: 18px;
    }

    .bmpt-logo h1 {
        font-size: 26px;
        margin-bottom: 8px;
    }

    .bmpt-subtitle {
        font-size: 14px;
    }

    .bmpt-form-title {
        font-size: 15px;
        margin-top: 16px;
        padding-top: 16px;
    }

    .bmpt-progress-container {
        max-width: 100%;
    }

    .bmpt-progress-wrapper {
        padding: 24px 20px;
    }

    .bmpt-progress-bar {
        height: 6px;
        margin-bottom: 22px;
    }

    .bmpt-progress-steps {
        gap: 4px;
    }

    .step-number {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .step-label {
        font-size: 11px;
    }

    .bmpt-form-main {
        padding: 20px 15px;
    }

    .step-title {
        font-size: 20px;
    }

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

    .academic-table-wrapper {
        font-size: 13px;
    }

    .academic-table th,
    .academic-table td {
        padding: 8px 4px;
    }

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

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

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* Draft notification mobile */
    .draft-notification-content {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
        text-align: center;
    }

    .draft-icon {
        font-size: 36px;
    }

    .draft-actions {
        flex-direction: column;
        width: 100%;
    }

    .draft-actions .btn {
        width: 100%;
    }

    .draft-save-indicator {
        top: 10px;
        right: 10px;
        left: 10px;
        font-size: 12px;
        padding: 10px;
    }

    .draft-id-display {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        margin-top: 15px;
    }

    .draft-url-input {
        font-size: 11px;
        padding: 6px 10px;
    }

    .btn-copy-draft {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .bmpt-form-header {
        padding: 24px 16px;
    }

    .bmpt-logo h1 {
        font-size: 22px;
    }

    .bmpt-subtitle {
        font-size: 13px;
    }

    .bmpt-form-title {
        font-size: 14px;
    }

    .bmpt-progress-wrapper {
        padding: 20px 16px;
    }

    .bmpt-progress-bar {
        margin-bottom: 18px;
    }

    .step-number {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .step-label {
        display: none;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    textarea {
        font-size: 16px;
    }
}

/* Server-Side Draft Management */
.draft-button-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-save-draft {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-save-draft:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.btn-save-draft.saving {
    opacity: 0.6;
    cursor: wait;
}

.btn-save-draft.saved {
    background: #4caf50;
    border-color: #4caf50;
}

.draft-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.draft-id-display {
    margin-top: 20px;
    padding: 14px 18px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.draft-id-label {
    color: #6b7280;
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
}

.draft-url-input {
    flex: 1;
    background: #fff;
    color: #111827;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
}

.draft-url-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.draft-url-input:hover {
    border-color: #9ca3af;
}

.btn-copy-draft {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-copy-draft:hover {
    background: #1d4ed8;
}

.btn-copy-draft svg {
    width: 14px;
    height: 14px;
}

.draft-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.draft-status.show {
    opacity: 0.7;
}

/* Draft Loaded Banner */
.draft-loaded-banner {
    background: #059669;
    color: #fff;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.banner-icon {
    font-size: 32px;
}

.banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.banner-text strong {
    font-size: 16px;
}

.banner-text span {
    font-size: 14px;
    opacity: 0.9;
}

.banner-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.banner-close:hover {
    opacity: 1;
}

/* Loading Overlay */
.draft-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Draft Toast */
.draft-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.draft-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.draft-toast.success {
    background: #4caf50;
}

.draft-toast.error {
    background: #f44336;
}

.draft-toast.info {
    background: #2196f3;
}

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

/* Crop Modal Styles */
.crop-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.crop-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.crop-modal-header {
    padding: 20px 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.crop-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.crop-modal-size {
    font-size: 14px;
    color: #6b7280;
}

.crop-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.crop-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.crop-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.crop-container {
    max-height: 400px;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
    margin-bottom: 16px;
}

.crop-container img {
    max-width: 100%;
    display: block;
}

.crop-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.crop-controls label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
    white-space: nowrap;
}

.crop-controls input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #d1d5db;
    outline: none;
    -webkit-appearance: none;
}

.crop-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crop-controls input[type="range"]::-webkit-slider-thumb:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.crop-controls input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.crop-controls input[type="range"]::-moz-range-thumb:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.crop-modal-footer {
    padding: 16px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel-crop {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-cancel-crop:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-apply-crop {
    background: #2563eb;
    color: #fff;
    border: none;
}

.btn-apply-crop:hover {
    background: #1d4ed8;
}

@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        text-align: center;
    }

    .draft-button-container {
        width: 100%;
    }

    .btn-save-draft {
        width: 100%;
        justify-content: center;
    }

    /* Crop modal mobile styles */
    .crop-modal-content {
        max-height: 95vh;
        margin: 10px;
    }

    .crop-modal-header {
        padding: 16px 20px;
    }

    .crop-modal-body {
        padding: 16px;
    }

    .crop-container {
        max-height: 300px;
    }

    .crop-modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }

    .crop-modal-footer .btn {
        width: 100%;
    }

    .crop-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    /* Review thumbnails mobile */
    .review-documents-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .review-thumbnail {
        width: 100px;
        height: 100px;
    }

    /* Success modal mobile styles */
    .success-modal-content {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        position: fixed;
        bottom: 0;
        top: auto;
        max-height: 85vh;
        transform: translateY(100%);
    }

    .success-modal.show .success-modal-content {
        transform: translateY(0);
    }

    .success-modal-body {
        padding: 32px 24px 24px;
    }

    .success-modal-footer {
        padding: 16px 24px 24px;
    }

    .success-title {
        font-size: 20px;
    }

    .success-icon-wrapper {
        width: 80px;
        height: 80px;
    }

    .success-checkmark {
        width: 80px;
        height: 80px;
    }
}

/* ============================================================
   SUCCESS MODAL STYLES
   ============================================================ */

.success-modal {
    display: none;
    position: fixed;
    z-index: 999999; /* Higher than crop modal */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-modal.show {
    opacity: 1;
}

.success-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-modal.show .success-modal-content {
    transform: scale(1);
}

.success-modal-body {
    padding: 48px 40px 32px;
    text-align: center;
}

/* Success Icon with Animation */
.success-icon-wrapper {
    width: 96px;
    height: 96px;
    margin: 0 auto 24px;
    position: relative;
}

.success-checkmark {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #10b981;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 40px rgba(16, 185, 129, 0.1); }
}

/* Success Title */
.success-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 24px;
}

/* Success Details */
.success-details {
    text-align: left;
    background: #f9fafb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.success-message {
    font-size: 16px;
    color: #374151;
    line-height: 1.6;
    margin: 0 0 16px;
    font-weight: 500;
}

.success-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.success-info strong {
    color: #374151;
    font-weight: 600;
}

#successAppId {
    color: #2563eb;
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 600;
    font-size: 13px;
}

.success-next-steps {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.success-modal-footer {
    padding: 20px 40px 32px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-success-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

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

/* Form Submitted State */
.form-submitted {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.form-submitted::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* ============================================================
   FORM CLOSED STATE STYLES
   ============================================================ */

.bmpt-form-closed {
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bmpt-closed-content {
    text-align: center;
    padding: 60px 40px;
    max-width: 500px;
}

.bmpt-closed-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.bmpt-closed-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
    letter-spacing: -0.025em;
}

.bmpt-closed-message {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Mobile responsive for closed state */
@media (max-width: 768px) {
    .bmpt-form-closed {
        min-height: 300px;
    }

    .bmpt-closed-content {
        padding: 40px 24px;
    }

    .bmpt-closed-icon {
        font-size: 56px;
        margin-bottom: 20px;
    }

    .bmpt-closed-title {
        font-size: 22px;
    }

    .bmpt-closed-message {
        font-size: 15px;
    }
}
