/* Reset & Base Styles */
* {
    margin: 0;
 padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
  --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
    --text-light: #9ca3af;
--background: #f9fafb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --success: #4caf50;
    --danger: #ef4444;

    /* Spacing */
 --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;

    /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md) 0;
}

.header-content {
    display: flex;
  justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
}

.back-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: var(--spacing-3xl) 0;
}

/* Steps Indicator */
.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.step-item {
    display: flex;
flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.step-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-light);
    background: var(--surface);
transition: all var(--transition-base);
}

.step-item.active .step-circle {
    background: var(--primary-gradient);
  border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.step-item span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.step-item.active span {
    color: var(--primary-color);
    font-weight: 600;
}

/* Clickable step indicator */
.step-item.completed .step-circle {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.step-item.clickable {
    cursor: pointer;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item.clickable:hover .step-circle {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.step-item.clickable:hover span {
    color: #667eea;
}

.step-line {
    width: 4rem;
    height: 2px;
    background: var(--border);
    margin: 0 var(--spacing-sm);
}

/* Upload Section */
.upload-section {
    text-align: center;
}

.upload-header {
    margin-bottom: var(--spacing-xl);
}

.upload-header h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.upload-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.upload-area {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-2xl);
padding: var(--spacing-3xl) var(--spacing-xl);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.upload-area:hover::before,
.upload-area.drag-over::before {
    opacity: 1;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    margin-bottom: var(--spacing-md);
}

.upload-icon svg {
    stroke: var(--primary-color);
    opacity: 0.8;
}

.upload-area h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.file-types {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    color: var(--text-light);
    font-size: 0.875rem;
}

.btn-browse {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.4);
}

.btn-browse:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.5);
}

.upload-note {
  display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
 margin-top: var(--spacing-lg);
    color: var(--text-light);
    font-size: 0.875rem;
}

.upload-note svg {
stroke: var(--text-light);
}

/* File Preview */
.file-preview {
    text-align: center;
}

.preview-header {
    margin-bottom: var(--spacing-xl);
}

.preview-header h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.preview-header h2::before {
    content: '';
    width: 2rem;
    height: 2rem;
  background: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='9' fill='%234caf50'/%3E%3Cpath d='M6 10L9 13L14 7' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.preview-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.preview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
transition: all var(--transition-base);
}

.preview-card:hover {
    box-shadow: var(--shadow-md);
}

.preview-icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-icon svg {
    stroke: var(--primary-color);
}

.preview-info {
    flex: 1;
    text-align: left;
}

.preview-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.preview-info p {
    color: var(--text-secondary);
 font-size: 0.9375rem;
}

.preview-actions .btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preview-actions .btn-icon:hover {
    background: var(--background);
    border-color: var(--danger);
}

.preview-actions .btn-icon:hover svg {
    stroke: var(--danger);
}

.preview-actions .btn-icon svg {
    stroke: var(--text-secondary);
}

.preview-actions-bar {
    display: flex;
  gap: var(--spacing-md);
    justify-content: center;
}

/* Buttons */
.btn-primary,
.btn-secondary {
display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--transition-fast);
cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: var(--background);
}

/* Upload Progress */
.upload-progress {
    text-align: center;
    padding: var(--spacing-3xl) 0;
}

.progress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.progress-icon {
    position: relative;
    width: 5rem;
    height: 5rem;
}

.progress-circle {
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    transform: rotate(-90deg);
    transform-origin: center;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        stroke-dashoffset: 126;
}
    50% {
        stroke-dashoffset: 63;
}
    100% {
        stroke-dashoffset: 0;
    }
}

.upload-progress h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.upload-progress p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Quick Actions */
.quick-actions {
    margin-top: var(--spacing-3xl);
    padding-top: var(--spacing-3xl);
    border-top: 1px solid var(--border);
}

.quick-actions h3 {
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
  align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.action-card:hover {
transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.action-card svg {
    stroke: var(--primary-color);
}

.action-card span {
    font-weight: 500;
    color: var(--text-primary);
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--spacing-lg) 0;
    margin-top: auto;
}

.footer p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .steps-indicator {
        margin-bottom: var(--spacing-xl);
    }

    .step-item span {
        display: none;
    }

    .step-line {
    width: 2rem;
    }

 .upload-area {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .upload-header h1 {
        font-size: 1.75rem;
    }

    .preview-actions-bar {
        flex-direction: column;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .back-link span {
   display: none;
    }
    
    /* Mobile placeholder text for verification code */
    .verification-form #VerificationCode::placeholder {
  font-size: 0.7rem !important;
    }
    .verification-form #VerificationCode::-webkit-input-placeholder {
        font-size: 0.7rem !important;
    }
    .verification-form #VerificationCode::-moz-placeholder {
  font-size: 0.7rem !important;
    }
    .verification-form #VerificationCode:-ms-input-placeholder {
      font-size: 0.7rem !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
 opacity: 1;
        transform: translateY(0);
    }
}

.file-preview,
.upload-progress {
    animation: fadeIn 0.3s ease-out;
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Document Form Styles */
.document-form {
    max-width: 700px;
    margin: 2rem auto 0;
    padding: 2rem 2.5rem;
    background: var(--surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease-out;
}

.form-header {
 text-align: center;
    margin-bottom: 1.5rem;
}

.form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.form-header p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.signing-form {
    /* Form wrapper styles */
}

.form-section {
    margin-bottom: 1.25rem;
}

.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    margin-bottom: 0.625rem;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-input-full,
.form-input-half,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-family);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.form-input-full::placeholder,
.form-input-half::placeholder,
.form-textarea::placeholder {
 color: var(--text-light);
}

.form-input-full:focus,
.form-input-half:focus,
.form-textarea:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
  grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.add-message-btn {
    background: transparent;
    border: none;
color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
  font-family: var(--font-family);
    cursor: pointer;
    padding: 0.375rem 0;
    transition: color var(--transition-base);
    display: flex;
 align-items: center;
    gap: 0.5rem;
}

.add-message-btn:hover {
    color: var(--primary-dark);
}

.message-area {
    margin-top: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
 gap: 0.625rem;
    cursor: pointer;
  color: var(--text-secondary);
 font-size: 0.875rem;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.btn-get-signed {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-family);
    color: white;
    background: linear-gradient(135deg, #b8336a 0%, #7c2d5e 100%);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: 0.05em;
    box-shadow: 0 4px 14px rgba(184, 51, 106, 0.4);
}

.btn-get-signed:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 51, 106, 0.5);
}

.btn-get-signed.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-get-signed.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Verification Form Styles */
.verification-form {
    display: none;
    max-width: 700px;
    margin: 2rem auto 0;
    padding: 2rem 2.5rem;
 background: var(--surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease-out;
}

.verification-form .form-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.verification-form .form-header p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.verification-form #VerificationCode {
    letter-spacing: .35em;
    text-align: center;
font-weight: 600;
    font-size: 1.25rem;
    padding: 0.75rem;
}

.verification-form .form-section {
    margin-bottom: 1.5rem;
}

.verification-form .verification-email {
    font-weight: 600;
  color: var(--text-primary);
}

.verification-form .resend-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.verification-form .resend-link:hover:not(.disabled) {
    text-decoration: underline;
}

.verification-form .resend-link.disabled {
    color: var(--text-light);
    cursor: not-allowed;
}

/* jQuery Validation Error Styles */
.field-validation-error {
    display: block;
    color: var(--danger);
  font-size: 0.875rem;
    margin-top: 0.375rem;
}

.field-validation-valid {
    display: none;
}

.input-validation-error {
    border-color: var(--danger) !important;
    background-color: #fef2f2 !important;
}

.validation-summary-errors {
    background-color: #fef2f2;
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.validation-summary-errors ul {
    margin: 0;
padding-left: 1.25rem;
    list-style-type: disc;
}

.validation-summary-errors li {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.validation-summary-valid {
    display: none;
}

/* Validation visuals */
.validation-summary {
    background-color: #fef2f2;
    border: 1px solid #ef4444;
    color: #b91c1c;
 border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}
.validation-summary ul{ margin:0; padding-left: 1.25rem; }
.input-validation-error{ border-color:#ef4444 !important; background:#fff1f2 !important; }
.field-validation-error{ display:block; color:#b91c1c; margin-top:.375rem; }

/* Small shake to attract attention */
@keyframes shakeX{ 10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(2px)} 30%,50%,70%{transform:translateX(-4px)} 40%,60%{transform:translateX(4px)} }
.shake{ animation:shakeX .35s ease-in-out 1; }

/* Form row validation support */
.form-row > div {
    flex: 1;
  display: flex;
 flex-direction: column;
}

/* Modal Styles */
#SendingDialog .modal-body {
    display: flex;
  align-items: center;
    gap: 0.75rem;
}

#SendingDialog .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .document-form,
    .verification-form {
    padding: 1.75rem 2rem;
        margin: 1.5rem auto 0;
  }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .document-form,
 .verification-form {
        padding: 1.5rem;
        margin: 1rem auto 0;
     max-width: 100%;
    }

    .form-header h2 {
        font-size: 1.25rem;
    }

    .form-header p {
        font-size: 0.875rem;
    }

    .form-section {
    margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .document-form,
    .verification-form {
        padding: 1.25rem;
    border-radius: var(--radius-xl);
    }

    .form-input-full,
    .form-input-half,
    .form-textarea {
      padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .btn-get-signed {
        padding: 0.875rem 1.25rem;
   font-size: 0.9375rem;
    }
}
