/**
 * Responsivo - Sistema de Cadastro Moeble
 *
 * @package MoebleCadastro
 */

/* ==========================================================================
   Tablet (768px - 1024px)
   ========================================================================== */
@media screen and (max-width: 1024px) {
    .moeble-cadastro-card {
        padding: 32px;
    }

    .moeble-cadastro-title {
        font-size: 28px;
    }
}

/* ==========================================================================
   Mobile Large (481px - 767px)
   ========================================================================== */
@media screen and (max-width: 767px) {
    .moeble-cadastro-container {
        padding: 16px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .moeble-cadastro-wrapper {
        max-width: 100%;
    }

    .moeble-cadastro-card {
        padding: 24px;
        border-radius: 16px;
    }

    .moeble-cadastro-header {
        margin-bottom: 24px;
    }

    .moeble-cadastro-logo {
        max-width: 120px;
    }

    .moeble-cadastro-title {
        font-size: 32px;
    }

    .moeble-cadastro-subtitle {
        font-size: 14px;
    }

    /* Fields */
    .moeble-field {
        margin-bottom: 20px;
    }

    .moeble-field-input {
        font-size: 16px;
        padding: 10px 0;
    }

    .moeble-field-select,
    .moeble-field-textarea {
        padding: 12px 14px;
        font-size: 16px;
    }

    /* Choices - já verticais no desktop, apenas ajustar altura */
    .moeble-choice-label {
        height: 52px;  /* Levemente menor no mobile */
        border-radius: 26px !important;
    }

    /* Address Grid */
    .moeble-address-row-2,
    .moeble-address-row-3 {
        grid-template-columns: 1fr;
    }

    /* Buttons */
    .moeble-btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    /* Login - campos mobile */
    .moeble-field-shell {
        height: 52px !important;
        padding: 0 50px 0 20px !important;
        border-radius: 26px !important;
    }

    .moeble-field-shell .moeble-field-input {
        font-size: 16px !important;
    }

    .moeble-toggle-password {
        right: 14px !important;
    }

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

    /* Botão entrar mobile */
    .moeble-login-form .moeble-btn-primary {
        padding: 12px 32px !important;
        font-size: 13px !important;
    }

    .moeble-btn-group {
        flex-direction: column;
    }

    /* Navigation */
    .moeble-form-nav {
        flex-direction: column-reverse;
        gap: 16px;
    }

    .mc-back-link,
    a.mc-back-link {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .moeble-form-nav .moeble-btn {
        width: 100%;
    }

    /* Analysis Page */
    .moeble-analysis-page {
        padding: 40px 16px;
    }

    .moeble-analysis-icon {
        width: 64px;
        height: 64px;
    }

    .moeble-analysis-icon svg {
        width: 32px;
        height: 32px;
    }

    .moeble-analysis-title {
        font-size: 20px;
    }

    .moeble-analysis-description {
        font-size: 14px;
    }

    /* Modal */
    .moeble-modal-content {
        padding: 24px;
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .moeble-modal-title {
        font-size: 18px;
    }
}

/* ==========================================================================
   Mobile Small (até 480px)
   ========================================================================== */
@media screen and (max-width: 480px) {
    .moeble-cadastro-container {
        padding: 12px;
        padding-top: 20px;
    }

    .moeble-cadastro-card {
        padding: 20px;
        border-radius: 12px;
    }

    .moeble-cadastro-logo {
        max-width: 100px;
    }

    .moeble-cadastro-title {
        font-size: 28px;
    }

    .moeble-cadastro-subtitle {
        font-size: 13px;
    }

    /* Progress */
    .moeble-progress-text {
        font-size: 11px;
    }

    /* Fields */
    .moeble-field-label {
        font-size: 13px;
    }

    .moeble-field-error {
        font-size: 12px;
    }

    /* Choices */
    .moeble-choice-label {
        padding: 12px 14px;
        font-size: 14px;
    }

    .moeble-choice-icon {
        font-size: 24px;
    }

    /* Checkbox */
    .moeble-checkbox-label {
        font-size: 13px;
    }

    /* Choices mobile pequeno */
    .moeble-choice-label {
        height: 48px;
        border-radius: 24px !important;
        font-size: 13px;
    }

    .moeble-choice-icon {
        width: 18px;
        height: 18px;
    }

    /* Login mobile pequeno */
    .moeble-field-shell {
        height: 48px !important;
        padding: 0 48px 0 18px !important;
        border-radius: 24px !important;
    }

    .moeble-field-shell .moeble-field-input {
        font-size: 16px !important; /* Mínimo 16px para evitar zoom no iOS */
    }

    .moeble-toggle-password {
        right: 12px !important;
    }

    .moeble-toggle-password svg {
        width: 16px !important;
        height: 16px !important;
    }

    .moeble-login-form .moeble-btn-primary {
        padding: 10px 28px !important;
        font-size: 12px !important;
        width: 100%;
    }

    .moeble-login-links {
        flex-direction: column;
        gap: 12px;
    }

    .moeble-login-links a {
        font-size: 13px;
    }

    /* Messages */
    .moeble-message {
        padding: 12px;
        font-size: 13px;
    }

    /* Login */
    .moeble-login-links a {
        font-size: 13px;
    }

    .moeble-divider {
        font-size: 12px;
    }
}

/* ==========================================================================
   Height Considerations (Short screens)
   ========================================================================== */
@media screen and (max-height: 600px) {
    .moeble-cadastro-container {
        align-items: flex-start;
        padding-top: 20px;
    }

    .moeble-cadastro-card {
        padding: 20px;
    }

    .moeble-cadastro-header {
        margin-bottom: 16px;
    }

    .moeble-cadastro-logo {
        margin-bottom: 12px;
    }

    .moeble-progress {
        margin-bottom: 20px;
    }

    .moeble-field {
        margin-bottom: 16px;
    }

    .moeble-btn-group {
        margin-top: 20px;
    }
}

/* ==========================================================================
   Landscape Mobile
   ========================================================================== */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .moeble-cadastro-container {
        min-height: auto;
        padding: 16px;
    }

    .moeble-cadastro-card {
        max-height: none;
    }

    .moeble-cadastro-header {
        display: flex;
        align-items: center;
        gap: 16px;
        text-align: left;
        margin-bottom: 20px;
    }

    .moeble-cadastro-logo {
        max-width: 80px;
        margin-bottom: 0;
    }

    .moeble-cadastro-title {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .moeble-cadastro-subtitle {
        font-size: 12px;
    }
}

/* ==========================================================================
   Dark Mode Overrides (if system prefers)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    /* Already dark theme, but can add extra contrast if needed */
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */
@media (prefers-contrast: high) {
    :root {
        --mc-border: #555555;
        --mc-text-muted: #888888;
    }

    .moeble-field-input,
    .moeble-field-select,
    .moeble-field-textarea {
        border-width: 3px;
    }

    .moeble-btn {
        border: 2px solid currentColor;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .moeble-cadastro-container {
        background: white;
        padding: 0;
    }

    .moeble-cadastro-card {
        box-shadow: none;
        padding: 20px;
    }

    .moeble-btn,
    .moeble-form-nav,
    .moeble-progress {
        display: none;
    }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .moeble-choice-label {
        min-height: 48px;
    }

    .moeble-btn {
        min-height: 48px;
    }

    .moeble-checkbox-input {
        width: 24px;
        height: 24px;
    }

    /* Remove hover effects on touch */
    .moeble-choice-label:hover {
        border-color: #333333;
        color: #A1A1A1;
    }

    .moeble-btn:hover:not(:disabled) {
        transform: none;
    }
}
