/* Customer Page Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo i {
    font-size: 3rem;
    color: #22c55e;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
}

.subtitle {
    color: #6b7280;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Form Wrapper */
.form-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.form-container {
    max-width: 100%;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header i {
    font-size: 3rem;
    color: #22c55e;
    margin-bottom: 15px;
}

.form-header h2 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 10px;
    font-weight: 700;
}

.form-header p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Form Styles */
.customer-form {
    display: grid;
    gap: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.form-group label i {
    color: #22c55e;
    width: 18px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    max-width: 100%;
}

/* iOS Safari specific fixes */
.form-group input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3e%3cline x1='16' y1='2' x2='16' y2='6'/%3e%3cline x1='8' y1='2' x2='8' y2='6'/%3e%3cline x1='3' y1='10' x2='21' y2='10'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}

.form-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2'%3e%3cpolyline points='6,9 12,15 18,9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 50px;
}

/* Prevent zoom on iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: max(16px, 1rem);
    }
}

/* Photo Upload */
.photo-group {
    grid-column: 1 / -1;
}

.photo-upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f9fafb;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.photo-upload-area:hover {
    border-color: #22c55e;
    background: #f0fdf4;
}

.photo-upload-area.dragover {
    border-color: #22c55e;
    background: #f0fdf4;
    transform: scale(1.02);
}

.photo-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 15px;
}

.upload-placeholder p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.upload-placeholder span {
    color: #22c55e;
    font-weight: 600;
    text-decoration: underline;
}

.upload-placeholder small {
    color: #9ca3af;
    font-size: 0.9rem;
}

.photo-preview {
    margin-top: 20px;
    text-align: center;
}

.photo-preview img {
    max-width: 250px;
    max-height: 250px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-primary,
.btn-secondary {
    padding: 18px 30px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* Success Card */
.success-card {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 20px;
    border: 2px solid #bbf7d0;
    margin-top: 30px;
}

.success-icon {
    margin-bottom: 20px;
}

.success-icon i {
    font-size: 4rem;
    color: #22c55e;
}

.success-card h3 {
    font-size: 1.8rem;
    color: #166534;
    margin-bottom: 15px;
    font-weight: 700;
}

.success-card p {
    color: #166534;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.success-actions .btn-primary,
.success-actions .btn-secondary {
    flex: none;
    min-width: 150px;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info p {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.footer-info i {
    color: #22c55e;
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.admin-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    .header {
        padding: 25px 20px;
        margin-bottom: 20px;
    }
    
    .logo {
        flex-direction: column;
        gap: 8px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .form-wrapper {
        padding: 25px 15px;
        margin-bottom: 20px;
        border-radius: 15px;
    }
    
    .form-header {
        margin-bottom: 25px;
    }
    
    .form-header i {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .form-header p {
        font-size: 1rem;
    }
    
    .customer-form {
        gap: 20px;
    }
    
    .form-group {
        gap: 6px;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 15px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
        margin-top: 15px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 14px 20px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .photo-upload-area {
        padding: 25px 15px;
        border-radius: 10px;
    }
    
    .upload-placeholder i {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .upload-placeholder p {
        font-size: 1rem;
        margin-bottom: 4px;
    }
    
    .upload-placeholder small {
        font-size: 0.85rem;
    }
    
    .photo-preview img {
        max-width: 200px;
        max-height: 200px;
        border-radius: 10px;
    }
    
    .success-card {
        padding: 35px 20px;
        border-radius: 15px;
        margin-top: 20px;
    }
    
    .success-card h3 {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .success-card p {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .success-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .success-actions .btn-primary,
    .success-actions .btn-secondary {
        min-width: auto;
        width: 100%;
    }
    
    .footer {
        padding: 20px 15px;
        border-radius: 15px;
        margin-top: 0;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-info p {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }
    
    .admin-link {
        padding: 12px 18px;
        font-size: 0.95rem;
        border-radius: 8px;
        align-self: center;
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .header {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .logo h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .form-wrapper {
        padding: 20px 12px;
        border-radius: 12px;
    }
    
    .form-header {
        margin-bottom: 20px;
    }
    
    .form-header i {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    .form-header h2 {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .form-header p {
        font-size: 0.95rem;
    }
    
    .customer-form {
        gap: 18px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 11px 14px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 18px;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    .photo-upload-area {
        padding: 20px 12px;
        border-radius: 8px;
    }
    
    .upload-placeholder i {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .upload-placeholder p {
        font-size: 0.95rem;
    }
    
    .upload-placeholder small {
        font-size: 0.8rem;
    }
    
    .photo-preview img {
        max-width: 180px;
        max-height: 180px;
        border-radius: 8px;
    }
    
    .success-card {
        padding: 25px 15px;
        border-radius: 12px;
    }
    
    .success-card h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .success-card p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .footer {
        padding: 18px 12px;
        border-radius: 12px;
    }
    
    .footer-info p {
        font-size: 0.85rem;
    }
    
    .admin-link {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-width: 140px;
    }
}

/* Fix for very small screens */
@media (max-width: 360px) {
    .container {
        padding: 5px;
    }
    
    .form-wrapper {
        padding: 15px 10px;
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: max(16px, 0.85rem); /* Prevent zoom on iOS */
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 11px 16px;
        font-size: 0.9rem;
    }
    
    .photo-upload-area {
        padding: 15px 8px;
        min-height: 100px;
    }
    
    .upload-placeholder i {
        font-size: 1.8rem;
    }
    
    .upload-placeholder p {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }
    
    .upload-placeholder small {
        font-size: 0.75rem;
    }
}

/* Additional mobile-specific fixes */
@media (max-width: 480px) {
    /* Ensure inputs don't cause zoom on iOS */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: max(16px, 0.9rem);
    }
    
    /* Fix for photo upload area on small screens */
    .photo-upload-area {
        min-height: 110px;
        padding: 20px 10px;
    }
    
    .upload-placeholder {
        width: 100%;
        max-width: 100%;
    }
    
    .upload-placeholder p {
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Ensure buttons are touch-friendly */
    .btn-primary,
    .btn-secondary {
        min-height: 44px; /* iOS recommended touch target size */
        touch-action: manipulation;
    }
    
    /* Fix for success card on mobile */
    .success-card {
        margin: 15px 0;
    }
    
    /* Footer responsive fixes */
    .footer {
        margin-top: 15px;
    }
    
    .admin-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Landscape orientation on phones */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 15px 20px;
        margin-bottom: 15px;
    }
    
    .form-wrapper {
        padding: 20px 15px;
    }
    
    .form-header {
        margin-bottom: 20px;
    }
    
    .form-header i {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    .customer-form {
        gap: 15px;
    }
    
    .photo-upload-area {
        padding: 15px 12px;
        min-height: 80px;
    }
}

/* Fix for form validation messages */
.error-message {
    word-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}