/* ===================================================== CLALMOBILE FORMS v1.0 Inputs, Buttons, Form Groups ===================================================== */ /* ===== FORM LAYOUT ===== */ .form-section { margin-bottom: var(--space-6); } .form-section-title { font-size: var(--text-lg); font-weight: 700; color: var(--text-1); margin-bottom: var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); } .form-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; } @media (min-width: 480px) { .form-grid.two-col { grid-template-columns: repeat(2, 1fr); } } .form-group { display: flex; flex-direction: column; gap: var(--space-2); } .form-group.full-width { grid-column: 1 / -1; } /* ===== LABELS ===== */ .form-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-2); } .form-label .required { color: var(--accent); margin-inline-start: 2px; } .form-helper { font-size: var(--text-xs); color: var(--muted-1); } /* ===== INPUT BASE ===== */ .input, .form-input { width: 100%; height: var(--input-height); padding: 0 var(--space-4); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text-1); font-size: var(--text-base); font-family: inherit; transition: all var(--duration-fast) var(--ease-out); } .input::placeholder, .form-input::placeholder { color: var(--muted-1); } .input:hover, .form-input:hover { border-color: var(--muted-2); } .input:focus, .form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1); } /* Input sizes */ .input-sm { height: var(--btn-height-sm); padding: 0 var(--space-3); font-size: var(--text-sm); } .input-lg { height: var(--btn-height-lg); padding: 0 var(--space-5); font-size: var(--text-lg); } /* Input states */ .input-error, .form-input.error { border-color: var(--error) !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1); } .input-success, .form-input.success { border-color: var(--success) !important; } /* Disabled state */ .input:disabled, .form-input:disabled { opacity: 0.5; cursor: not-allowed; background: var(--bg-3); } /* ===== INPUT WITH ICON ===== */ .input-wrapper { position: relative; } .input-wrapper .input, .input-wrapper .form-input { padding-inline-start: 44px; } .input-wrapper.icon-end .input, .input-wrapper.icon-end .form-input { padding-inline-start: var(--space-4); padding-inline-end: 44px; } .input-icon { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted-1); pointer-events: none; inset-inline-start: var(--space-3); } .input-wrapper.icon-end .input-icon { inset-inline-start: auto; inset-inline-end: var(--space-3); } .input-icon svg { width: 20px; height: 20px; } /* Clickable icon (for password toggle, clear, etc.) */ .input-action { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: var(--space-2); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: var(--r-md); cursor: pointer; color: var(--muted-1); transition: color var(--duration-fast) var(--ease-out); } .input-action:hover { color: var(--text-1); } .input-action svg { width: 20px; height: 20px; } /* ===== TEXTAREA ===== */ .textarea, .form-textarea { width: 100%; min-height: 120px; padding: var(--space-3) var(--space-4); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text-1); font-size: var(--text-base); font-family: inherit; resize: vertical; transition: all var(--duration-fast) var(--ease-out); } .textarea:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1); } /* ===== SELECT ===== */ .select, .form-select { width: 100%; height: var(--input-height); padding: 0 var(--space-4); padding-inline-end: 44px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text-1); font-size: var(--text-base); font-family: inherit; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; transition: all var(--duration-fast) var(--ease-out); } [dir="rtl"] .select, [dir="rtl"] .form-select { background-position: left 12px center; } .select:focus, .form-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1); } /* ===== CHECKBOX ===== */ .checkbox-group { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; } .checkbox-input { position: relative; width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; } .checkbox-input input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; } .checkbox-visual { position: absolute; inset: 0; background: var(--bg-2); border: 2px solid var(--border); border-radius: var(--r-sm); transition: all var(--duration-fast) var(--ease-out); } .checkbox-input input:checked + .checkbox-visual { background: var(--accent); border-color: var(--accent); } .checkbox-input input:checked + .checkbox-visual::after { content: ""; position: absolute; left: 6px; top: 3px; width: 6px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); } .checkbox-input input:focus + .checkbox-visual { box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1); } .checkbox-label { font-size: var(--text-sm); color: var(--text-2); line-height: var(--leading-normal); } .checkbox-label a { color: var(--accent); text-decoration: underline; } /* ===== RADIO ===== */ .radio-group { display: flex; flex-direction: column; gap: var(--space-3); } .radio-option { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--r-lg); transition: all var(--duration-fast) var(--ease-out); } .radio-option:hover { border-color: var(--muted-2); background: var(--bg-2); } .radio-option.selected { border-color: var(--accent); background: rgba(225, 29, 72, 0.05); } .radio-input { position: relative; width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; } .radio-input input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; } .radio-visual { position: absolute; inset: 0; background: var(--bg-2); border: 2px solid var(--border); border-radius: var(--r-full); transition: all var(--duration-fast) var(--ease-out); } .radio-input input:checked + .radio-visual { border-color: var(--accent); } .radio-input input:checked + .radio-visual::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; background: var(--accent); border-radius: var(--r-full); transform: translate(-50%, -50%); } .radio-content { flex: 1; } .radio-label { font-size: var(--text-base); font-weight: 500; color: var(--text-1); } .radio-description { font-size: var(--text-sm); color: var(--muted-1); margin-top: var(--space-1); } /* ===== BUTTONS ===== */ .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--btn-height); padding: 0 var(--space-5); font-size: var(--text-base); font-weight: 600; font-family: inherit; border-radius: var(--r-lg); border: none; cursor: pointer; transition: all var(--duration-fast) var(--ease-out); text-decoration: none; white-space: nowrap; } .btn svg { width: 20px; height: 20px; } /* Button sizes */ .btn-sm { height: var(--btn-height-sm); padding: 0 var(--space-3); font-size: var(--text-sm); } .btn-sm svg { width: 16px; height: 16px; } .btn-lg { height: var(--btn-height-lg); padding: 0 var(--space-6); font-size: var(--text-lg); } .btn-lg svg { width: 24px; height: 24px; } /* Primary button */ .btn-primary { background: var(--accent); color: white; } .btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); } .btn-primary:active { transform: translateY(0); } /* Secondary button */ .btn-secondary { background: var(--bg-3); color: var(--text-1); } .btn-secondary:hover { background: var(--muted-2); } /* Outline button */ .btn-outline { background: transparent; color: var(--text-1); border: 1px solid var(--border); } .btn-outline:hover { background: var(--bg-3); border-color: var(--muted-2); } /* Ghost button */ .btn-ghost { background: transparent; color: var(--text-2); } .btn-ghost:hover { background: var(--bg-3); color: var(--text-1); } /* Accent outline */ .btn-accent-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); } .btn-accent-outline:hover { background: rgba(225, 29, 72, 0.1); } /* Full width */ .btn-block { width: 100%; } /* Icon only button */ .btn-icon { width: var(--btn-height); padding: 0; } .btn-icon.btn-sm { width: var(--btn-height-sm); } .btn-icon.btn-lg { width: var(--btn-height-lg); } /* Disabled state */ .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; } /* Loading state */ .btn-loading { position: relative; color: transparent !important; pointer-events: none; } .btn-loading::after { content: ""; position: absolute; width: 20px; height: 20px; border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: white; border-radius: 50%; animation: btn-spin 0.6s linear infinite; } .btn-secondary.btn-loading::after { border-color: rgba(0, 0, 0, 0.1); border-top-color: var(--text-1); } @keyframes btn-spin { to { transform: rotate(360deg); } } /* ===== ERROR MESSAGE ===== */ .form-error { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--error); margin-top: var(--space-1); } .form-error svg { width: 14px; height: 14px; flex-shrink: 0; } /* ===== PHONE INPUT ===== */ .phone-input-wrapper { display: flex; gap: var(--space-2); } .phone-prefix { width: 80px; flex-shrink: 0; } .phone-number { flex: 1; } /* ===== CITY AUTOCOMPLETE ===== */ .autocomplete-wrapper { position: relative; } .autocomplete-list { position: absolute; top: calc(100% + var(--space-1)); left: 0; right: 0; max-height: 200px; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); z-index: var(--z-dropdown); display: none; } .autocomplete-wrapper.open .autocomplete-list { display: block; } .autocomplete-item { padding: var(--space-3); cursor: pointer; font-size: var(--text-sm); color: var(--text-2); transition: background var(--duration-fast) var(--ease-out); } .autocomplete-item:hover, .autocomplete-item.highlighted { background: var(--bg-3); color: var(--text-1); } .autocomplete-item mark { background: rgba(225, 29, 72, 0.2); color: var(--accent); } /* ===== QUANTITY INPUT ===== */ .quantity-input { display: inline-flex; align-items: center; gap: 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); } .quantity-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: transparent; border: none; cursor: pointer; color: var(--text-2); transition: all var(--duration-fast) var(--ease-out); } .quantity-btn:hover { color: var(--text-1); background: var(--bg-3); } .quantity-btn:first-child { border-radius: var(--r-lg) 0 0 var(--r-lg); } .quantity-btn:last-child { border-radius: 0 var(--r-lg) var(--r-lg) 0; } .quantity-btn svg { width: 16px; height: 16px; } .quantity-value { width: 48px; text-align: center; font-size: var(--text-base); font-weight: 600; color: var(--text-1); border: none; background: transparent; } .quantity-value::-webkit-inner-spin-button, .quantity-value::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }