/* ============================================
   Professional Modern Form Styles - Static App
   ============================================ */

/* CSS Variables for Form Styling */
:root {
    /* Form Label Color */
    --form-label-color: #64748b;
    
    /* Form Input Styling */
    --form-input-bg: #ffffff;
    --form-input-border: #e2e8f0;
    --form-input-focus-border: #3b82f6;
    --form-input-focus-ring: rgba(59, 130, 246, 0.18);
    --form-text-color: #0f172a;
    --form-hint-color: #94a3b8;
    --form-error-color: #ef4444;
    --form-required-color: #ef4444;
    --form-control-height: 44px;
    
    /* Tooltip */
    --tooltip-bg: #1e293b;
    --tooltip-text: #ffffff;
    
    /* Icon Colors */
    --icon-color: #64748b;
    --icon-color-hover: #3b82f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Phone frame: show app inside a mobile device (same as index.css) */
.phone-frame {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
}

.phone {
    width: 375px;
    max-width: 100%;
    height: 667px;
    max-height: 90vh;
    min-height: 400px;
    padding: 30px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--card-bg, #fff);
    box-shadow: 0 0 0 12px #0f0f0f, 0 0 0 14px #2a2a2a, 0 25px 60px rgba(0, 0, 0, 0.5);
    border-radius: 36px;
    overflow: hidden;
}

.phone-frame .phone {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Logo */
.logo-container {
    margin-bottom: 24px;
}

.logo-box {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.logo-content {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo-f {
    font-size: 48px;
    font-weight: 800;
    color: #1e293b;
    font-style: italic;
    text-shadow: 2px 2px 0px rgba(59, 130, 246, 0.3);
}

.logo-p {
    font-size: 48px;
    font-weight: 800;
    color: #3b82f6;
    font-style: italic;
    text-shadow: 2px 2px 0px rgba(59, 130, 246, 0.2);
}

.logo-text {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 2px;
}

.logo-text-blue {
    color: #3b82f6;
}

/* Tab Switcher */
.tab-container {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 24px;
    width: 300px;

    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    color: #64748b;
}

.tab-btn:hover {
    color: #3b82f6;
}

.tab-btn.active {
    background: #ffffff;
    color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Form Card */
.form-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-card.hidden {
    display: none;
}

/* Input Groups - Modern Bordered Style */
.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    background: var(--form-input-bg);
    border: 1px solid var(--form-input-border);
    border-radius: 10px;
    padding: 0 14px;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.input-group:hover {
    border-color: #94a3b8;
}

.input-group:focus-within {
    border-color: var(--form-input-focus-border);
    box-shadow: 0 0 0 3px var(--form-input-focus-ring);
}


.input-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-color);
    flex-shrink: 0;
    transition: color 0.2s;
}

.input-group:focus-within .input-icon {
    color: var(--form-input-focus-border);
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

/* Form Input - Modern Style */
.form-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--form-text-color);
    background: transparent;
    min-width: 0;
    height: 100%;
    padding: 0;
}

.form-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
    opacity: 0.8;
}

.form-input:focus::placeholder {
    opacity: 0.5;
}

/* Password Toggle */
.toggle-password {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-color);
    border-radius: 6px;
    transition: all 0.2s;
    margin-right: -6px;
}

.toggle-password:hover {
    color: var(--icon-color-hover);
    background: rgba(59, 130, 246, 0.08);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.toggle-password .hidden {
    display: none;
}

/* Info Button */
.info-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-color);
    border-radius: 6px;
    transition: all 0.2s;
    margin-right: -6px;
}

.info-btn:hover {
    color: var(--icon-color-hover);
    background: rgba(59, 130, 246, 0.08);
}

.info-btn svg {
    width: 16px;
    height: 16px;
}

/* Select Dropdown */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 28px;
    height: 100%;
}

.dropdown-arrow {
    position: absolute;
    right: 12px;
    color: var(--icon-color);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.input-group:focus-within .dropdown-arrow {
    color: var(--form-input-focus-border);
}

.dropdown-arrow svg {
    width: 16px;
    height: 16px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 14px 24px;
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.submit-btn:hover::before {
    opacity: 1;
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.submit-btn span {
    position: relative;
    z-index: 1;
}

/* Forgot Password */
.forgot-password {
    margin-top: 20px;
}

.forgot-password a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.forgot-password.hidden {
    display: none;
}

/* Remember Me */
.remember-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 300px;
    margin-top: 24px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}

.remember-container.hidden {
    display: none;
}

.remember-text {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(22px);
}

/* Version Text */
.version-text {
    margin-top: 24px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

/* Date Input Styling */
input[type="date"] {
    color: #94a3b8;
}

input[type="date"]:focus,
input[type="date"]:valid {
    color: var(--form-text-color);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.6;
    cursor: pointer;
    filter: invert(50%);
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    }

    .phone-frame {
        padding: 0;
        background: #f8fafc;
    }

    .phone-frame .phone {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        padding: 24px 16px;
    }

    .form-card {
        max-width: 100%;
        padding: 24px 20px;
        border-radius: 14px;
    }

    .tab-container {
        width: 100%;
        max-width: 300px;
    }

    .remember-container {
        max-width: 100%;
    }
    
    .input-group {
        height: 48px;
    }
}

/* Scrollable New User Form */
#newUserForm {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

#newUserForm::-webkit-scrollbar {
    width: 6px;
}

#newUserForm::-webkit-scrollbar-track {
    background: transparent;
}

#newUserForm::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 6px;
}

#newUserForm::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Form Label (for future use with labeled inputs) */
.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--form-label-color);
    text-transform: capitalize;
    letter-spacing: 0.05em;
    line-height: 1.4;
    margin-bottom: 6px;
    display: block;
}

/* Form Hint Text */
.form-hint {
    font-size: 12px;
    color: var(--form-hint-color);
    margin-top: 4px;
    font-weight: 400;
    line-height: 1.4;
}

/* Form Error State */
.input-group.error {
    border-color: var(--form-error-color);
}

.input-group.error:focus-within {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.form-error {
    font-size: 12px;
    color: var(--form-error-color);
    margin-top: 4px;
    font-weight: 500;
}

/* Input Disabled State */
.input-group.disabled {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.7;
}

.input-group.disabled .form-input {
    cursor: not-allowed;
    color: #94a3b8;
}
