/* Register Page Styles - iOS-Inspired Design */

/* Field Error Messages */
.field-error {
    display: none;
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: var(--border-radius);
    animation: fadeIn 0.3s ease-in-out;
}

.field-error.show {
    display: block;
}

.field-error i {
    margin-right: 6px;
}

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

.register-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: #f5f5f7;
}

/* Desktop background image - same as login page */
/* ✅ UPDATED: Uses Express endpoint instead of static file */
@media (min-width: 641px) {
    .register-container {
        background: 
            linear-gradient(
                135deg,
                rgba(116, 28, 71, 0.85) 0%,
                rgba(166, 77, 121, 0.75) 100%
            ),
            url('/api/background-image');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }
}

.register-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

/* Desktop card styling - same as login page */
@media (min-width: 641px) {
    .register-card {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(0, 0, 0, 0.05);
    }
}

/* Hero Section */
.register-hero {
    margin-bottom: 24px;
}

.register-hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
    line-height: 1.2;
}

.register-hero p {
    font-size: 0.9375rem;
    color: #6e6e73;
    line-height: 1.5;
    margin: 0;
}

/* Step Progress Indicator - iOS Style */
.step-progress {
    margin-bottom: 24px;
}

.step-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.step-counter {
    font-size: 0.8125rem;
    color: #6e6e73;
    font-weight: 500;
}

.step-subtitle {
    font-size: 0.8125rem;
    color: #6e6e73;
    font-weight: 500;
}

.step-progress-bar {
    display: flex;
    gap: 4px;
    height: 6px;
}

.step-segment {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e5e5e7;
    transition: all 0.3s ease;
    cursor: pointer;
}

.step-segment[data-step="1"].active,
.step-segment[data-step="2"].active,
.step-segment[data-step="3"].active,
.step-segment[data-step="4"].active {
    background: rgba(116, 28, 71, 0.35);
    border: 1px solid #741C47;
}

.step-segment.completed {
    background: #741C47;
}

/* Form Section Cards */
.form-section-card {
    background: #ffffff;
    border: 1px solid #e5e5e7;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-footer {
    font-size: 0.75rem;
    color: #6e6e73;
    display: block;
    margin-top: 8px;
}

.section-title .section-footer {
    font-size: 0.875rem;
    font-weight: 400;
    margin: 0;
}

.section-description {
    font-size: 0.875rem;
    color: #6e6e73;
    line-height: 1.5;
    margin-bottom: 16px;
    margin-top: -8px;
}

/* Input with Icon */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 16px;
    color: #6e6e73;
    font-size: 0.875rem;
    z-index: 1;
    pointer-events: none;
}

.input-with-icon input,
.input-with-icon select {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: none;
    background: #f5f5f7;
    border-radius: 12px;
    font-size: 0.9375rem;
    color: #1d1d1f;
    font-family: 'Poppins', Arial, sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.input-with-icon input:focus,
.input-with-icon select:focus {
    outline: none;
    background: #e5e5e7;
}

.input-with-icon input::placeholder {
    color: #86868b;
}

.input-with-icon select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236e6e73' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

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

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6e6e73;
    margin-bottom: 6px;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Multi-step Form */
.form-step {
    display: none;
    animation: fadeInSlide 0.4s ease-out;
}

.form-step.active {
    display: block;
}

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

/* Step Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e7;
}

.step-navigation .btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', Arial, sans-serif;
}

.step-navigation .btn-primary {
    background: #741C47;
    color: #ffffff;
}

.step-navigation .btn-primary:hover:not(:disabled) {
    background: #5a1538;
}

.step-navigation .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.step-navigation .btn-secondary {
    background: #A64D79;
    color: #ffffff;
}

.step-navigation .btn-secondary:hover:not(:disabled) {
    background: #741C47;
}

/* Error Banner */
.error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(220, 38, 38, 0.9);
    color: #ffffff;
    border-radius: 14px;
    margin-bottom: 20px;
    animation: slideInError 0.4s ease-out;
}

.error-banner i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.error-banner span {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.5;
}

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

/* Image Upload Styles */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.image-preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

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

.image-preview {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #A64D79;
}

/* Logo Preview */
.logo-preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

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

.logo-container .logo-preview {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.logo-container .logo-preview img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: contain;
    border: 2px solid #A64D79;
}

.image-upload-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.image-upload-actions .btn {
    font-size: 0.875rem;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e5e5e7;
    background: #ffffff !important;
    color: #1d1d1f !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', Arial, sans-serif;
}

.image-upload-actions .btn:hover {
    background: #f5f5f7 !important;
    color: #1d1d1f !important;
}

.image-upload-actions .btn i {
    margin-right: 6px;
    color: #1d1d1f !important;
}

.image-upload-actions .btn:hover i {
    color: #1d1d1f !important;
}

.image-upload-actions .btn.hidden {
    display: none;
}

/* Error and Success Messages */
.error-message {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.05));
    border: 2px solid #dc2626;
    color: #dc2626;
    padding: 16px 20px;
    border-radius: 12px;
    margin: 16px 0;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.2);
    animation: slideInError 0.4s ease-out;
}

.success-message {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    border: 2px solid #22c55e;
    color: #16a34a;
    padding: 16px 20px;
    border-radius: 12px;
    margin: 16px 0;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
    animation: slideInSuccess 0.4s ease-out;
}

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

.success-message.show {
    animation: pulseSuccess 0.6s ease-in-out;
}

@keyframes pulseSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Quill Editor Styles */
#defaultProjectDescription-editor,
#defaultTerms-editor {
    min-height: 200px;
}

.ql-toolbar {
    background: #f5f5f7;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.ql-container {
    background: #ffffff;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    color: #1d1d1f;
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 0.9375rem;
}

.ql-editor {
    min-height: 200px;
    color: #1d1d1f;
}

.ql-editor.ql-blank::before {
    color: #86868b;
}

/* Make headings dark in Quill editor */
.ql-editor h1,
.ql-editor h2,
.ql-editor h3,
.ql-editor h4,
.ql-editor h5,
.ql-editor h6 {
    color: #1d1d1f !important;
}

.ql-editor p,
.ql-editor ul,
.ql-editor ol,
.ql-editor li {
    color: #1d1d1f;
}

/* Custom scrollbar for register card */
.register-card::-webkit-scrollbar {
    width: 8px;
}

.register-card::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 4px;
}

.register-card::-webkit-scrollbar-thumb {
    background: #86868b;
    border-radius: 4px;
}

.register-card::-webkit-scrollbar-thumb:hover {
    background: #6e6e73;
}

/* Responsive - Mobile First */
@media (max-width: 640px) {
    .register-container {
        padding: 0;
        background: #f5f5f7;
        background-attachment: scroll;
    }

    .register-card {
        border-radius: 0;
        padding: 20px;
        margin-top: 0;
        box-shadow: none;
        max-width: 100%;
        background: #ffffff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
    }

    .register-hero h1 {
        font-size: 1.5rem;
    }

    .register-hero p {
        font-size: 0.875rem;
    }

    .step-progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .form-section-card {
        padding: 12px;
        border-radius: 12px;
    }

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

    .step-navigation {
        flex-direction: column;
        gap: 12px;
    }

    .step-navigation .btn {
        width: 100%;
    }

    .image-preview {
        width: 100px;
        height: 100px;
    }

    .logo-container .logo-preview {
        width: 100px;
        height: 100px;
    }
}
