/* ============================================
   Brick Calculator & Login Plugin Styles v2.0
   Author: Amir Cohen
   ============================================ */

/* General Styles */
.brick-login-container,
.brick-calculator-container {
    max-width: 700px;
    margin: 30px auto;
    padding: 35px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.brick-login-container:hover,
.brick-calculator-container:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.brick-login-container h3,
.brick-calculator-container h3 {
    margin-top: 0;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 28px;
    text-align: center;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 18px;
    font-weight: 700;
    animation: slideDown 0.5s ease-out;
}

/* Form Styles */
.brick-login-form,
.brick-calculator-form {
    width: 100%;
}

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

.brick-form-group {
    margin-bottom: 22px;
}

.brick-form-group label {
    display: block;
    margin-bottom: 10px;
    color: #34495e;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.brick-form-group input[type="text"],
.brick-form-group input[type="password"],
.brick-form-group input[type="email"],
.brick-form-group input[type="tel"],
.brick-form-group input[type="number"],
.brick-form-group select,
.brick-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fafafa;
}

.brick-form-group input[type="text"]:focus,
.brick-form-group input[type="password"]:focus,
.brick-form-group input[type="email"]:focus,
.brick-form-group input[type="tel"]:focus,
.brick-form-group input[type="number"]:focus,
.brick-form-group select:focus,
.brick-form-group textarea:focus {
    outline: none;
    border-color: #e74c3c;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15);
}

.brick-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.brick-form-group input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Checkbox Group */
.brick-checkbox-group {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.brick-checkbox-group:hover {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe9e9 100%);
}

.brick-checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: #495057;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.brick-checkbox-label:last-child {
    margin-bottom: 0;
}

.brick-checkbox-label:hover {
    color: #e74c3c;
}

/* Buttons */
.brick-login-btn,
.brick-calc-btn,
.brick-quote-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Button wrapper alignment helpers (admin-controlled) */
.brick-login-btn-wrapper,
.brick-calc-btn-wrapper,
.brick-quote-btn-wrapper {
    width: 100%;
}
.brick-login-btn-wrapper button,
.brick-calc-btn-wrapper button,
.brick-quote-btn-wrapper button {
    margin: 0 auto;
}

.brick-login-btn:hover,
.brick-calc-btn:hover,
.brick-quote-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.brick-login-btn:active,
.brick-calc-btn:active,
.brick-quote-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.brick-login-btn:disabled,
.brick-calc-btn:disabled,
.brick-quote-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.brick-quote-btn svg {
    width: 22px;
    height: 22px;
    animation: pulse 2s infinite;
}

/* Login Links */
.brick-login-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #ecf0f1;
}

.brick-login-links a {
    color: #e74c3c;
    text-decoration: none;
    margin: 0 15px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.brick-login-links a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Login Message */
.brick-login-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    animation: fadeIn 0.5s ease-out;
}

.brick-login-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #b1dfbb;
}

.brick-login-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #f1aeb5;
}

.brick-login-message a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 700;
}

.brick-login-message a:hover {
    text-decoration: underline;
}

/* Disclaimer */
.brick-disclaimer {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe9a8 100%);
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: slideIn 0.6s ease-out;
}

.brick-disclaimer svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #856404;
    width: 24px;
    height: 24px;
}

.brick-disclaimer p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.6;
}

.brick-disclaimer strong {
    color: #664d03;
}

/* Calculator Results */
.brick-results {
    margin-top: 35px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 3px solid #e74c3c;
    animation: slideUp 0.5s ease-out;
    box-shadow: 0 6px 25px rgba(231, 76, 60, 0.15);
}

.brick-results h4 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 22px;
    text-align: center;
    font-weight: 700;
}

.brick-results-content {
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 2px solid #ecf0f1;
    font-size: 17px;
    transition: background 0.3s ease;
}

.result-row:hover {
    background: #f8f9fa;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 6px;
}

.result-row:last-of-type {
    border-bottom: none;
}

.result-label {
    color: #7f8c8d;
    font-weight: 600;
}

.result-value {
    color: #2c3e50;
    font-weight: 700;
    font-size: 18px;
}

.result-total {
    margin-top: 20px;
    padding-top: 20px !important;
    border-top: 3px solid #e74c3c !important;
    font-size: 22px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe9e9 100%) !important;
    padding: 20px !important;
    border-radius: 8px;
}

.result-total .result-label {
    color: #2c3e50;
}

.result-total .result-value {
    color: #e74c3c;
    font-size: 26px;
}

.result-range {
    text-align: center;
    margin-top: 18px;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    color: #856404;
    border: 2px solid #ffc107;
    font-weight: 600;
}

/* Quote Request Section */
.brick-quote-request {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 3px solid #3498db;
    animation: fadeIn 0.8s ease-out;
}

.brick-quote-request h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 22px;
    text-align: center;
    font-weight: 700;
}

.quote-intro {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.6;
}

.quote-response-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.quote-response-message.success {
    display: block;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #b1dfbb;
}

.quote-response-message.error {
    display: block;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #f1aeb5;
}

/* Plugin Footer */
.brick-plugin-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #ecf0f1;
    text-align: center;
}

.brick-plugin-footer p {
    margin: 0;
    color: #95a5a6;
    font-size: 13px;
    line-height: 1.6;
}

.brick-plugin-footer a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.brick-plugin-footer a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Loading State */
.brick-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.brick-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .brick-login-container,
    .brick-calculator-container {
        margin: 20px;
        padding: 25px;
        border-radius: 10px;
    }
    
    .brick-login-container h3,
    .brick-calculator-container h3 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .brick-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .brick-form-group {
        margin-bottom: 18px;
    }
    
    .brick-form-group input,
    .brick-form-group select,
    .brick-form-group textarea {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .brick-login-btn,
    .brick-calc-btn,
    .brick-quote-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .brick-login-links a {
        display: block;
        margin: 12px 0;
    }
    
    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 0;
    }
    
    .result-value {
        font-size: 17px;
    }
    
    .result-total {
        font-size: 20px;
    }
    
    .result-total .result-value {
        font-size: 24px;
    }
    
    .brick-results {
        padding: 20px;
        margin-top: 25px;
    }
    
    .brick-results h4 {
        font-size: 20px;
    }
    
    .brick-results-content {
        padding: 18px;
    }
    
    .brick-quote-request {
        padding: 20px;
    }
    
    .brick-disclaimer {
        flex-direction: column;
        padding: 15px;
    }
    
    .brick-disclaimer svg {
        width: 20px;
        height: 20px;
    }
    
    .brick-disclaimer p {
        font-size: 13px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .brick-login-container,
    .brick-calculator-container {
        margin: 15px;
        padding: 20px;
        border-radius: 8px;
    }
    
    .brick-login-container h3,
    .brick-calculator-container h3 {
        font-size: 22px;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .brick-form-group label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .brick-form-group input,
    .brick-form-group select,
    .brick-form-group textarea {
        padding: 12px;
        font-size: 14px;
    }
    
    .brick-login-btn,
    .brick-calc-btn,
    .brick-quote-btn {
        padding: 13px 18px;
        font-size: 15px;
    }
    
    .brick-checkbox-group {
        padding: 15px;
    }
    
    .brick-checkbox-label {
        font-size: 14px;
    }
    
    .result-row {
        font-size: 15px;
        padding: 10px 0;
    }
    
    .result-value {
        font-size: 16px;
    }
    
    .result-total {
        font-size: 18px;
        padding: 15px !important;
    }
    
    .result-total .result-value {
        font-size: 22px;
    }
    
    .brick-results {
        padding: 18px;
        margin-top: 20px;
    }
    
    .brick-results h4 {
        font-size: 19px;
        margin-bottom: 20px;
    }
    
    .brick-results-content {
        padding: 15px;
    }
    
    .brick-quote-request {
        padding: 18px;
        margin-top: 25px;
    }
    
    .brick-quote-request h4 {
        font-size: 20px;
    }
    
    .quote-intro {
        font-size: 14px;
    }
    
    .brick-plugin-footer {
        margin-top: 25px;
        padding-top: 15px;
    }
    
    .brick-plugin-footer p {
        font-size: 12px;
    }
}

/* Large Desktop (1200px and above) */
@media (min-width: 1200px) {
    .brick-login-container,
    .brick-calculator-container {
        max-width: 800px;
        padding: 40px;
    }
    
    .brick-results {
        padding: 35px;
    }
    
    .brick-quote-request {
        padding: 35px;
    }
}

/* Elementor Compatibility */
.elementor-widget-container .brick-login-container,
.elementor-widget-container .brick-calculator-container {
    margin: 0;
}

/* Print Styles */
@media print {
    .brick-login-btn,
    .brick-calc-btn,
    .brick-quote-btn,
    .brick-login-links {
        display: none;
    }
    
    .brick-results {
        border: 2px solid #000;
        page-break-inside: avoid;
    }
    
    .brick-plugin-footer {
        page-break-before: avoid;
    }
}

/* Accessibility Enhancements */
*:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 3px solid #e74c3c;
    outline-offset: 3px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .brick-login-container,
    .brick-calculator-container {
        border: 3px solid #000;
    }
    
    .brick-form-group input,
    .brick-form-group select,
    .brick-form-group textarea {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
