:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --accent-light: #5f8ee4;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-color: #2c2c2c;
    --text-light: #6b6b6b;
    --bg-color: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --white: #ffffff;
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --border-color: #e2e8f0;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.15);
    --shadow-colored: rgba(102, 126, 234, 0.3);
}

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

body {
    font-family: 'Raleway', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Grain Texture Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeIn 1s ease-out;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: slideDown 0.8s ease-out;
}

.logo-container {
    display: inline-block;
}

.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.logo-underline {
    width: 100%;
    height: 2px;
    background: var(--accent-gradient);
    animation: expandWidth 1.2s ease-out 0.3s backwards;
    border-radius: 2px;
}

/* Main Content */
.main-content {
    animation: slideUp 1s ease-out 0.2s backwards;
}

.intro-section {
    text-align: center;
    margin-bottom: 50px;
}

.page-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    animation: fadeIn 1s ease-out 0.4s backwards;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 300;
    margin-bottom: 30px;
    animation: fadeIn 1s ease-out 0.6s backwards;
}

.decorative-line {
    width: 80px;
    height: 3px;
    background: var(--accent-gradient);
    margin: 0 auto;
    animation: expandWidth 0.8s ease-out 0.8s backwards;
    border-radius: 3px;
}

/* Form Styles */
.contact-form {
    background: var(--white);
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px var(--shadow-light), 0 0 0 1px var(--border-color);
    border: none;
    animation: fadeInScale 0.8s ease-out 0.5s backwards;
    position: relative;
    overflow: hidden;
}

.contact-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.form-fields {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 28px;
    animation: fadeInUp 0.6s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.6s; }
.form-group:nth-child(2) { animation-delay: 0.7s; }
.form-group:nth-child(3) { animation-delay: 0.8s; }
.form-group:nth-child(4) { animation-delay: 0.9s; }
.form-group:nth-child(5) { animation-delay: 1s; }

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.required {
    color: var(--secondary-color);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: 'Raleway', sans-serif;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 52px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-light);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(95, 142, 228, 0.1);
    transform: translateY(-1px);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-input::placeholder,
.form-select::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

/* Company Field */
.company-group {
    position: relative;
}

.company-field-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.company-input-wrapper {
    position: relative;
    flex: 1;
}

.company-dropdown {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-top: none;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 30px var(--shadow-medium);
    display: none;
    border-radius: 0 0 8px 8px;
}

.company-dropdown.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.company-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.company-item:last-child {
    border-bottom: none;
}

.company-item:hover {
    background: var(--bg-color);
}

.company-item.no-hover {
    cursor: default;
    color: var(--text-light);
    text-align: center;
    font-size: 0.9rem;
    padding: 16px;
}

.company-item.no-hover:hover {
    background: transparent;
}

.company-item.error-item {
    color: var(--error-color);
    font-weight: 500;
}

.company-name {
    font-weight: 500;
    color: var(--text-color);
}

.company-domain {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 2px;
}

.add-company-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: 2px solid var(--accent-light);
    color: var(--accent-light);
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    height: 52px;
}

.add-company-btn:hover {
    background: var(--accent-light);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-colored);
}

.add-company-btn svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.add-company-btn:hover svg {
    transform: rotate(90deg);
}

.add-company-btn .btn-text {
    display: inline;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 32px;
    background: var(--accent-gradient);
    color: var(--white);
    border: none;
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px var(--shadow-colored);
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-arrow {
    transform: translateX(4px);
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: none;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: var(--white);
    box-shadow: -4px 0 24px var(--shadow-heavy);
    overflow-y: auto;
    animation: slideInRight 0.4s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 40px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 8px;
}

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
    transform: rotate(90deg);
}

.account-form {
    padding: 40px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 14px 24px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-colored);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--accent-light);
    color: var(--accent-light);
}

/* Success Message */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 50px 60px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    text-align: center;
    display: none;
    border: 1px solid var(--border-color);
}

.success-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 16px 16px 0 0;
}

.success-message.active {
    display: block;
    animation: scaleIn 0.5s ease-out;
}

.success-message.active::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: -1;
    animation: fadeIn 0.3s ease-out;
}

.success-content {
    max-width: 400px;
}

.success-icon {
    color: var(--success-color);
    margin-bottom: 24px;
    animation: drawCheck 0.8s ease-out 0.2s backwards;
}

.success-message h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.success-message p {
    color: var(--text-light);
    font-size: 1.05rem;
}

/* Validation Styles */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
}

.error-message.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes drawCheck {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
}

.toast {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 320px;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 4px;
}

.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
    word-wrap: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

/* Toast Border Accent */
.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--error-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-info {
    border-left: 4px solid var(--info-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 30px 16px;
    }

    .logo {
        font-size: 2.5rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .contact-form {
        padding: 40px 24px;
        border-radius: 12px;
    }

    .modal-content {
        max-width: 100%;
    }

    .modal-header,
    .account-form {
        padding: 24px;
    }

    .success-message {
        padding: 40px 30px;
        margin: 0 20px;
    }

    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .company-field-row {
        flex-direction: column;
        gap: 12px;
    }

    .add-company-btn {
        width: 100%;
        height: auto;
    }

    .add-company-btn .btn-text {
        display: inline;
    }
}

@media (max-width: 480px) {
    .add-company-btn .btn-text {
        display: none;
    }

    .add-company-btn {
        padding: 14px;
        aspect-ratio: 1;
        width: 52px;
    }

    .company-field-row {
        flex-direction: row;
    }
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--border-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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