/* ============================================
   OS Websolutions Style Theme
   Legal Document Signing Application
   Light Professional Theme
   ============================================ */

:root {
    /* OS Websolutions Brand Colors */
    --os-blue: #0082CA;
    --os-blue-dark: #0066A3;
    --os-blue-light: #00A3E0;
    --os-blue-bg: #E6F2FF;
    
    /* Light Theme Colors */
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-off-white: #FAFBFC;
    --bg-pdf: #F5F7FA;
    
    /* Text Colors */
    --text-dark: #1A1A1A;
    --text-gray: #4A5568;
    --text-light-gray: #6B7280;
    --text-blue: #0082CA;
    
    /* Borders & Dividers */
    --border-light: #E5E8EB;
    --border-medium: #D1D5DB;
    --border-blue: rgba(0, 130, 202, 0.2);
    
    /* Status Colors */
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    
    /* 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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-blue: 0 4px 12px rgba(0, 130, 202, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 50%, #F8F9FA 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Subtle Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 130, 202, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 130, 202, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Logo Styles
   ============================================ */

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.logo-container::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--os-blue);
}

.logo {
    max-width: 280px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.logo svg {
    width: 100%;
    height: auto;
}

/* ============================================
   Container Styles
   ============================================ */

.container {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-light);
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--os-blue) 0%, var(--os-blue-light) 100%);
    border-radius: 16px 16px 0 0;
}

.container.wide {
    max-width: 1600px;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    border: none;
}

.container.wide::before {
    display: none;
}

/* ============================================
   Header Styles
   ============================================ */

.header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--os-blue);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--os-blue);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--os-blue);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.header p {
    font-size: 0.95rem;
    color: var(--text-gray);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ============================================
   Info Box
   ============================================ */

.info-box {
    background: var(--os-blue-bg);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--os-blue-dark);
    border: 1px solid rgba(0, 130, 202, 0.15);
    line-height: 1.8;
}

.info-box strong {
    font-weight: 600;
    color: var(--os-blue-dark);
    display: inline-block;
    min-width: 80px;
}

/* Hide info-box on sign page (sign.html) */
body:has(.form-pane) .info-box,
.form-pane .info-box {
    display: none !important;
}

/* ============================================
   Form Styles
   ============================================ */

.form-group {
    margin-bottom: 1.75rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    background: var(--bg-white);
    color: var(--text-dark);
    font-family: inherit;
}

input::placeholder {
    color: var(--text-light-gray);
    opacity: 0.6;
}

input:focus {
    outline: none;
    border-color: var(--os-blue);
    box-shadow: 0 0 0 4px rgba(0, 130, 202, 0.1);
    background: var(--bg-white);
}

input:hover:not(:focus) {
    border-color: var(--border-medium);
}

/* ============================================
   Button Styles
   ============================================ */

button {
    background: linear-gradient(135deg, var(--os-blue) 0%, var(--os-blue-dark) 100%);
    color: var(--bg-white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-md), var(--shadow-blue);
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    background: linear-gradient(135deg, var(--os-blue-light) 0%, var(--os-blue) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-blue);
}

button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md), var(--shadow-blue);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

button.secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

button.secondary:hover {
    background: var(--bg-light);
    border-color: var(--os-blue);
    box-shadow: var(--shadow-md);
}

button.success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    box-shadow: var(--shadow-md), 0 0 15px rgba(16, 185, 129, 0.2);
}

button.success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(16, 185, 129, 0.3);
}

/* ============================================
   Alert Styles
   ============================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    animation: slideDown 0.3s ease-out;
}

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

.alert.success {
    background-color: #D1FAE5;
    color: #065F46;
    border-color: #A7F3D0;
}

.alert.error {
    background-color: #FEE2E2;
    color: #991B1B;
    border-color: #FECACA;
}

/* ============================================
   Grid Layout
   ============================================ */

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .full-width {
        grid-column: span 2;
    }
}

/* ============================================
   Split Layout (Signing Page)
   ============================================ */

.split-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-light);
}

.pdf-pane {
    flex: 1;
    background: var(--bg-pdf);
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.pdf-pane::before {
    content: 'Document Preview';
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
    background: var(--bg-white);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.pdf-pane iframe {
    width: 100%;
    height: 100%;
    border: none;
    margin-top: 2.5rem;
}

.form-pane {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    background: var(--bg-white);
}

@media (min-width: 1024px) {
    .split-layout {
        flex-direction: row;
    }

    .pdf-pane {
        flex: 1.1;
        border-bottom: none;
        border-right: 2px solid var(--border-light);
    }

    .form-pane {
        flex: 0.9;
        max-width: 600px;
    }
}

/* ============================================
   Section Headers
   ============================================ */

h3 {
    color: var(--text-dark);
    margin-top: 2rem;
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

h3:first-child {
    margin-top: 0;
}

h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--os-blue);
}

/* ============================================
   Signature Canvas
   ============================================ */

.signature-pad {
    position: relative;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px dashed var(--border-medium);
    transition: all 0.3s ease;
}

.signature-pad:hover {
    border-color: var(--os-blue);
    background: var(--bg-off-white);
}


canvas {
    display: block;
    border: none;
    border-radius: 8px;
    cursor: crosshair;
    width: 100%;
    height: 200px;
    min-height: 200px;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    touch-action: none;
}






}

.clear-btn {
    position: absolute;
    top: 1.75rem;
    right: 1.75rem;
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
    color: var(--text-gray);
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.clear-btn:hover {
    background: var(--bg-light);
    border-color: var(--os-blue);
    color: var(--os-blue);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Loading State
   ============================================ */

#loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 500;
}

#loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ============================================
   Success Message
   ============================================ */

#successMessage {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.5s ease-out;
}

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

#successMessage div:first-child {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

#successMessage h2 {
    color: var(--text-dark);
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

#successMessage p {
    color: var(--text-gray);
    font-size: 1rem;
}

/* ============================================
   Preview Hint
   ============================================ */

#previewHint {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light-gray);
    margin-top: 1.25rem;
    font-style: italic;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem;
        margin: 1rem;
        border-radius: 12px;
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .header h2 {
        font-size: 1.5rem;
    }

    .form-pane {
        padding: 1.5rem;
    }

    .info-box {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .logo {
        max-width: 200px;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */

.form-pane::-webkit-scrollbar {
    width: 8px;
}

.form-pane::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.form-pane::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

.form-pane::-webkit-scrollbar-thumb:hover {
    background: var(--os-blue);
}

/* ============================================
   Success Message with URL
   ============================================ */

#successMessage {
    text-align: center;
    padding: 2rem 0;
    animation: fadeIn 0.5s ease-out;
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
    font-weight: 700;
}

#successMessage h2 {
    color: var(--os-blue);
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

#successMessage > p {
    color: var(--text-gray);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.url-with-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.url-link {
    color: var(--os-blue);
    text-decoration: none;
    font-size: 0.95rem;
    word-break: break-all;
    flex: 1;
    min-width: 200px;
    text-align: left;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.url-link:hover {
    color: var(--os-blue-dark);
    text-decoration: underline;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-white);
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--bg-light);
    border-color: var(--os-blue);
    color: var(--os-blue);
    transform: translateY(-1px);
}

.copy-icon-btn {
    color: var(--os-blue);
}

.copy-icon-btn:hover {
    background: var(--os-blue-bg);
    border-color: var(--os-blue);
}

.whatsapp-icon-btn {
    color: #25D366;
}

.whatsapp-icon-btn:hover {
    background: rgba(37, 211, 102, 0.1);
    border-color: #25D366;
    color: #20BA5A;
}

.copy-feedback {
    display: none;
    color: var(--success);
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

@media (max-width: 640px) {
    .url-with-icons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .url-link {
        text-align: center;
        min-width: auto;
    }
    
    .icon-btn {
        width: 100%;
        height: 40px;
    }
}

/* ============================================
   Focus Visible (Accessibility)
   ============================================ */

*:focus-visible {
    outline: 2px solid var(--os-blue);
    outline-offset: 2px;
}

button:focus-visible {
    outline-offset: 3px;
}
