@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.8);
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image: radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
                      radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
                      radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Glassmorphism Header */
header {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #1e293b 0%, #6366f1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Modern Card Effect */
.form-link, .admin-card, .builder-section, form {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-link:hover, .admin-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg), 0 0 20px var(--primary-glow);
    border-color: var(--primary);
}

.form-list {
    list-style: none;
    display: grid;
    gap: 1.5rem;
}

.form-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.form-link span {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Inputs & Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #334155;
}

input[type="text"],
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Premium Buttons */
.btn-submit, .btn-primary, .btn-danger {
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
    width: 100%;
    display: block;
}

.btn-submit, .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 6px -1px var(--primary-glow);
}

.btn-submit:hover, .btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Signature Pad */
.signature-container {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
    margin-top: 0.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.signature-pad {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.signature-pad canvas {
    display: block;
    width: 100% !important;
    height: 200px !important;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.signature-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

#clear-signature {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    width: auto;
}

#clear-signature:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Tables */
table {
    width: 100%;
    border-spacing: 0;
    margin-top: 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
}

th {
    background: #f1f5f9;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

tr:hover td {
    background-color: #f8fafc;
}

/* Footer */
footer {
    padding: 4rem 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

footer a {
    color: white;
    font-weight: 600;
    text-decoration: none;
    margin-left: 10px;
    opacity: 0.8;
}

footer a:hover { opacity: 1; }

.btn {
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    width: auto;
    display: inline-block;
}

.btn-danger { background: #ef4444; color: white; }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: var(--radius);
    max-width: 700px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
}

.modal-content canvas {
    display: block;
    width: 100% !important;
    height: 300px !important;
    border: 2px dashed var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    cursor: crosshair;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-actions button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
}

#modal-save { background: var(--primary); color: white; }
#modal-clear { background: #f1f5f9; color: #64748b; border: 1px solid var(--border); }
#modal-close { background: #94a3b8; color: white; }
